#! /bin/sh /usr/share/dpatch/dpatch-run
## 21_rename_optopt.dpatch by Roland Rosenfeld <roland@debian.org>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: rename optopt parameter name in getopt.c to make mips/mipsel
## DP: happy (otherwise their linker fails with the message
## DP: /usr/bin/ld: non-dynamic relocations refer to dynamic symbol optopt@@GLIBC_2.0
@DPATCH@
diff -urNad transfig~/fig2dev/getopt.c transfig/fig2dev/getopt.c
--- transfig~/fig2dev/getopt.c
+++ transfig/fig2dev/getopt.c
@@ -52,11 +52,11 @@
*/
int opterr = 1, /* useless, never set or used */
optind = 1, /* index into parent argv vector */
- optopt; /* character checked for validity */
+ fig_optopt; /* character checked for validity */
char *optarg; /* argument associated with option */
#define tell(s) fputs(*nargv,stderr);fputs(s,stderr); \
- fputc(optopt,stderr);fputc('\n',stderr);return(BADCH);
+ fputc(fig_optopt,stderr);fputc('\n',stderr);return(BADCH);
int
fig_getopt(nargc,nargv,ostr)
@@ -75,7 +75,7 @@
return(EOF);
}
} /* option letter okay? */
- if ((optopt = (int)*place++) == ARGCH || !(oli = index(ostr,optopt))) {
+ if ((fig_optopt = (int)*place++) == ARGCH || !(oli = index(ostr,fig_optopt))) {
if(!*place) ++optind;
tell(": illegal option -- ");
}
@@ -93,6 +93,6 @@
place = EMSG;
++optind;
}
- return(optopt); /* dump back option letter */
+ return(fig_optopt); /* dump back option letter */
}