aboutsummaryrefslogtreecommitdiff
path: root/scripts/mkflags.c
diff options
context:
space:
mode:
authorAshwini Sharma <ak.ashwini1981@gmail.com>2014-03-19 13:57:06 -0500
committerAshwini Sharma <ak.ashwini1981@gmail.com>2014-03-19 13:57:06 -0500
commit64f61640880011b991931ac30371719edd88e65d (patch)
tree2de61ccc62d5b3d7c37b8e73c6452a1168e8b5ce /scripts/mkflags.c
parent817d97ba626f86c376cb8311c099ea5f010205d5 (diff)
downloadtoybox-64f61640880011b991931ac30371719edd88e65d.tar.gz
There are cases when the long options are of the format abc-def. In current implementation FLAG_xxx macros are generated for long options too. with __-__ sign in the macro, it will generate errors.
I am of the opinion that __-__ be converted to '_' for generating the FLAG_xxx macros and be used in the command. This will enable the user to 'abc-def', but be handled like 'abc_def' in code.
Diffstat (limited to 'scripts/mkflags.c')
-rw-r--r--scripts/mkflags.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/mkflags.c b/scripts/mkflags.c
index 1cad5bf4..748e93d3 100644
--- a/scripts/mkflags.c
+++ b/scripts/mkflags.c
@@ -44,7 +44,7 @@ struct flag *digest(char *string)
blank->lopt = new;
list = blank;
}
- while (*++string != ')'); // An empty longopt () would break this.
+ while (*++string != ')') if (*string == '-') *string = '_'; // An empty longopt () would break this.
*(string++) = 0;
continue;
}