[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[trunk]: optional-arg-fix.patch
From: |
marc-alexandre autret |
Subject: |
[trunk]: optional-arg-fix.patch |
Date: |
Sun, 14 Oct 2001 22:03:18 +0000 (GMT) |
Hi,
All is in the ChangeLog.
I will add comments in the code to explain why
we do that.
Index: ChangeLog
===================================================================
RCS file: /cvsroot/bison/bison/ChangeLog,v
retrieving revision 1.225
diff -u -r1.225 ChangeLog
--- ChangeLog 2001/10/10 14:58:26 1.225
+++ ChangeLog 2001/10/14 19:58:26
@@ -1,3 +1,11 @@
+2001-10-14 Marc Autret <address@hidden>
+
+ When an options is declared having 'optional_argument' and
+ a flag is specified to be set, the option is skipped on
+ command line.
+
+ * src/options.c (create_long_option_table): Fix.
+
2001-10-10 Akim Demaille <address@hidden>
* src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
Index: src/options.c
===================================================================
RCS file: /cvsroot/bison/bison/src/options.c,v
retrieving revision 1.4
diff -u -r1.4 options.c
--- src/options.c 2001/10/04 14:55:20 1.4
+++ src/options.c 2001/10/14 19:58:28
@@ -142,7 +142,10 @@
/* Copy the struct information in the longoptions. */
longopts[j].name = option_table[i].name;
longopts[j].has_arg = option_table[i].has_arg;
- longopts[j].flag = option_table[i].set_flag;
+ if (longopts[j].has_arg == optional_argument)
+ longopts[j].flag = NULL;
+ else
+ longopts[j].flag = option_table[i].set_flag;
longopts[j++].val = option_table[i].val;
}
longopts[number_options].name = NULL;
--
Autret Marc (address@hidden)
Eleve Ingenieur en Informatique.
- [trunk]: optional-arg-fix.patch,
marc-alexandre autret <=