1
# <30-basename-fix.dpatch> by Daniel Kobras <kobras@debian.org>
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.
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.)
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
16
#include <sys/resource.h>
23
#include <sys/soundcard.h>
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 */
35
-extern char *basename(char *name);
40
void ErrDie(char *err);
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] */
51
- progname = basename(argv[0]); /* For errors */
52
+ tmp = strdup(argv[0]); /* POSIX basename may modify its arg */
53
+ progname = basename(tmp); /* For errors */
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
61
########## CHOOSE YOUR ARCHITECTURE: (NOTE: also see ../Makefile!)
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
68
# For FreeBSD (and maybe others), use these: