Sun Feb 21 00:36:06 2021 UTC ()
set explicit_file_name when we use getopt.


(christos)
diff -r1.19 -r1.20 src/external/bsd/byacc/dist/main.c

cvs diff -r1.19 -r1.20 src/external/bsd/byacc/dist/main.c (expand / switch to unified diff)

--- src/external/bsd/byacc/dist/main.c 2021/02/20 22:57:56 1.19
+++ src/external/bsd/byacc/dist/main.c 2021/02/21 00:36:06 1.20
@@ -1,19 +1,19 @@ @@ -1,19 +1,19 @@
1/* $NetBSD: main.c,v 1.19 2021/02/20 22:57:56 christos Exp $ */ 1/* $NetBSD: main.c,v 1.20 2021/02/21 00:36:06 christos Exp $ */
2 2
3#include "defs.h" 3#include "defs.h"
4 4
5#include <sys/cdefs.h> 5#include <sys/cdefs.h>
6__RCSID("$NetBSD: main.c,v 1.19 2021/02/20 22:57:56 christos Exp $"); 6__RCSID("$NetBSD: main.c,v 1.20 2021/02/21 00:36:06 christos Exp $");
7/* Id: main.c,v 1.70 2020/09/10 17:32:55 tom Exp */ 7/* Id: main.c,v 1.70 2020/09/10 17:32:55 tom Exp */
8 8
9#include <signal.h> 9#include <signal.h>
10#if !defined(_WIN32) || defined(__MINGW32__) 10#if !defined(_WIN32) || defined(__MINGW32__)
11#include <unistd.h> /* for _exit() */ 11#include <unistd.h> /* for _exit() */
12#else 12#else
13#include <stdlib.h> /* for _exit() */ 13#include <stdlib.h> /* for _exit() */
14#endif 14#endif
15 15
16 16
17#ifdef HAVE_MKSTEMP 17#ifdef HAVE_MKSTEMP
18# define USE_MKSTEMP 1 18# define USE_MKSTEMP 1
19#elif defined(HAVE_FCNTL_H) 19#elif defined(HAVE_FCNTL_H)
@@ -326,26 +326,27 @@ getargs(int argc, char *argv[]) @@ -326,26 +326,27 @@ getargs(int argc, char *argv[])
326 while ((ch = getopt(argc, argv, "Bb:dgH:ilLo:Pp:rstVvy")) != -1) 326 while ((ch = getopt(argc, argv, "Bb:dgH:ilLo:Pp:rstVvy")) != -1)
327 { 327 {
328 switch (ch) 328 switch (ch)
329 { 329 {
330 case 'b': 330 case 'b':
331 file_prefix = optarg; 331 file_prefix = optarg;
332 break; 332 break;
333 case 'H': 333 case 'H':
334 dflag = dflag2 = 1; 334 dflag = dflag2 = 1;
335 defines_file_name = optarg; 335 defines_file_name = optarg;
336 break; 336 break;
337 case 'o': 337 case 'o':
338 output_file_name = optarg; 338 output_file_name = optarg;
 339 explicit_file_name = 1;
339 break; 340 break;
340 case 'p': 341 case 'p':
341 symbol_prefix = optarg; 342 symbol_prefix = optarg;
342 break; 343 break;
343 default: 344 default:
344 setflag(ch); 345 setflag(ch);
345 break; 346 break;
346 } 347 }
347 } 348 }
348 if ((i = optind) < argc) 349 if ((i = optind) < argc)
349 { 350 {
350 /* getopt handles "--" specially, while we handle "-" specially */ 351 /* getopt handles "--" specially, while we handle "-" specially */
351 if (!strcmp(argv[i], "-")) 352 if (!strcmp(argv[i], "-"))