rather than just set to 0 (Benedict Lofstedt, #4220).
CVS patchset: 3208
CVS date: 1999/07/29 11:20:20
- add _mandir/_infodir macro expansions to docdirs (Tomasz Kloczko).
- add post install configurable dependency checking.
- fix: segfault on --rebuild (#4185).
+ - fix: getopt on non-linux requires optind to be saved/restored
+ rather than just set to 0 (Benedict Lofstedt, #4220).
3.0.1 -> 3.0.2
- eliminate armv4 entries from rpmrc (Andrew E. Mileski).
const char **optv;
int opte;
int c;
+ int saveoptind; /* XXX optind must be saved on non-linux */
/* Copy macro name as argv[0] */
argc = 0;
argc++;
}
-#if 0 /* XXX this is shell syntax, macros need !* to be "the rest" */
+#if 0
+/*
+ * The macro %* analoguous to the shell's $* means "Pass all non-macro
+ * parameters." Consequently, there needs to be a macro that means "Pass all
+ * (including macro parameters) options". This is useful for verifying
+ * parameters during expansion and yet transparently passing all parameters
+ * through for higher level processing (e.g. %description and/or %setup).
+ * This is the (potential) justification for %{**} ...
+ */
/* Add unexpanded args as macro */
- addMacro(mb->mc, "*", NULL, b, mb->depth);
+ addMacro(mb->mc, "**", NULL, b, mb->depth);
#endif
#ifdef NOTYET
opts = me->opts;
/* First count number of options ... */
- optind = 0;
+ saveoptind = optind; /* XXX optind must be saved on non-linux */
optc = 0;
optc++; /* XXX count argv[0] too */
while((c = getopt(argc, (char **)argv, opts)) != -1) {
optv[opte] = NULL;
/* ... and finally define option macros. */
- optind = 0;
+ optind = saveoptind; /* XXX optind must be restored on non-linux */
optc = 0;
- optc++; /* XXX count optv[0] */
+ optc++; /* XXX count optv[0] */
while((c = getopt(argc, (char **)argv, opts)) != -1) {
o = strchr(opts, c);
b = be;
const char **optv;
int opte;
int c;
+ int saveoptind; /* XXX optind must be saved on non-linux */
/* Copy macro name as argv[0] */
argc = 0;
argc++;
}
-#if 0 /* XXX this is shell syntax, macros need !* to be "the rest" */
+#if 0
+/*
+ * The macro %* analoguous to the shell's $* means "Pass all non-macro
+ * parameters." Consequently, there needs to be a macro that means "Pass all
+ * (including macro parameters) options". This is useful for verifying
+ * parameters during expansion and yet transparently passing all parameters
+ * through for higher level processing (e.g. %description and/or %setup).
+ * This is the (potential) justification for %{**} ...
+ */
/* Add unexpanded args as macro */
- addMacro(mb->mc, "*", NULL, b, mb->depth);
+ addMacro(mb->mc, "**", NULL, b, mb->depth);
#endif
#ifdef NOTYET
opts = me->opts;
/* First count number of options ... */
- optind = 0;
+ saveoptind = optind; /* XXX optind must be saved on non-linux */
optc = 0;
optc++; /* XXX count argv[0] too */
while((c = getopt(argc, (char **)argv, opts)) != -1) {
optv[opte] = NULL;
/* ... and finally define option macros. */
- optind = 0;
+ optind = saveoptind; /* XXX optind must be restored on non-linux */
optc = 0;
- optc++; /* XXX count optv[0] */
+ optc++; /* XXX count optv[0] */
while((c = getopt(argc, (char **)argv, opts)) != -1) {
o = strchr(opts, c);
b = be;