Let m4 accept a command-line argument (input file)
This unbreaks some configure scripts (reported by David Given)
This commit is contained in:
parent
5cb414f4d5
commit
f13d86f6e5
1 changed files with 13 additions and 1 deletions
|
@ -185,7 +185,7 @@ char *argv[];
|
|||
#endif
|
||||
initkwds();
|
||||
|
||||
while ((c = getopt(argc, argv, "tD:U:o:")) != EOF)
|
||||
while ((c = getopt(argc, argv, "tD:U:o:")) != EOF) {
|
||||
switch(c) {
|
||||
|
||||
case 'D': /* define something..*/
|
||||
|
@ -204,8 +204,20 @@ char *argv[];
|
|||
default:
|
||||
usage();
|
||||
}
|
||||
}
|
||||
|
||||
argc -= optind;
|
||||
argv += optind;
|
||||
|
||||
if(argc > 1) { usage(); }
|
||||
infile[0] = stdin; /* default input (naturally) */
|
||||
if(argc == 1) {
|
||||
if(!(infile[0] = fopen(argv[0], "r"))) {
|
||||
perror(argv[0]);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
active = stdout; /* default active output */
|
||||
m4temp = mktemp(divnam); /* filename for diversions */
|
||||
|
||||
|
|
Loading…
Reference in a new issue