~ubuntu-branches/ubuntu/jaunty/gramofile/jaunty

« back to all changes in this revision

Viewing changes to debian/30-basename-fix.dpatch

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Kobras
  • Date: 2005-04-29 13:20:02 UTC
  • mfrom: (2.1.1 warty)
  • Revision ID: james.westby@ubuntu.com-20050429132002-04317sw4cfn0s9bc
Tags: 1.6-7
40-fast-swap-and-buffer.dpatch: Lower optimisation level to the
standard -O2. On arm, the assembler chokes on -O3.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# <30-basename-fix.dpatch> by Daniel Kobras <kobras@debian.org>
 
2
#
 
3
# Use the POSIX basename(3), get rid of private prototype that wasn't used
 
4
# anyway. Remove the now unneeded REDHAT50 define from the Makefile.
 
5
#
 
6
# Explanation: Previously, the code used glibc's basename but didn't realise
 
7
# it was a GNU extension. Alternatively, one could define _GNU_SOURCE, but
 
8
# I opted for the--hopefully--more portable POSIX version. (Unlike the GNU
 
9
# version, the POSIX version may potentially modify its argument.)
 
10
#
 
11
#PATCHOPTIONS: -p1
 
12
--- gramofile-1.6.orig/bplaysrc/bplay.c 2001-05-05 16:13:55.000000000 +0200
 
13
+++ gramofile-1.6/bplaysrc/bplay.c      2004-01-07 18:34:49.000000000 +0100
 
14
@@ -20,6 +20,10 @@
 
15
 #include <sys/time.h>
 
16
 #include <sys/resource.h>
 
17
 
 
18
+#ifdef linux
 
19
+#include <libgen.h>
 
20
+#endif
 
21
+
 
22
 #ifndef __FreeBSD__
 
23
 #include <sys/soundcard.h>
 
24
 #else
 
25
@@ -53,16 +57,6 @@
 
26
 
 
27
 /* Prototypes */
 
28
 
 
29
-#ifdef linux
 
30
-/* This is in libc, but not in the header files. -- but it IS in
 
31
-   Red Hat 5.0.... Libc6?
 
32
-   well i'd guess its not in the headers because its nonstandard, i.e.
 
33
-   (probably) only exists on linux...  -nox */
 
34
-#ifndef REDHAT50
 
35
-extern char *basename(char *name);
 
36
-#endif
 
37
-#endif
 
38
-
 
39
 void Usage(void);
 
40
 void ErrDie(char *err);
 
41
 void Die(char *err);
 
42
@@ -107,11 +101,14 @@
 
43
        sndf_t filetype;                /* The file type */
 
44
        int mods;                       /* So user can override */
 
45
        int optc;                       /* For getopt */
 
46
+       char *tmp = NULL;               /* Do not clobber argv[0] */
 
47
 
 
48
        init_curses();
 
49
 
 
50
 #ifdef linux
 
51
-       progname = basename(argv[0]);   /* For errors */
 
52
+       tmp = strdup(argv[0]);          /* POSIX basename may modify its arg */
 
53
+       progname = basename(tmp);       /* For errors */
 
54
+       free(tmp);
 
55
 #else
 
56
        progname = strrchr(argv[0], '/');  /* Replacement for e.g. FreeBSD */
 
57
        if (!progname || !*++progname)
 
58
--- gramofile-1.6.orig/bplaysrc/Makefile        2001-05-05 16:13:55.000000000 +0200
 
59
+++ gramofile-1.6/bplaysrc/Makefile     2004-01-07 19:08:31.000000000 +0100
 
60
@@ -12,7 +12,7 @@
 
61
 ########## CHOOSE YOUR ARCHITECTURE:    (NOTE: also see ../Makefile!)
 
62
 
 
63
 # For Linux (and maybe others), use these:
 
64
-CFLAGS = -Wall -O2 -DUSEBUFFLOCK -DREDHAT50 -DLP2CD -DVUMETER # -DDEBUG
 
65
+CFLAGS = -Wall -O2 -DUSEBUFFLOCK -DLP2CD -DVUMETER # -DDEBUG
 
66
 LIBS = -lncurses
 
67
 
 
68
 # For FreeBSD (and maybe others), use these: