aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2013-08-29 21:56:17 +0300
committerArnold D. Robbins <arnold@skeeve.com>2013-08-29 21:56:17 +0300
commit6023b5f57f8b4869d75dd43ea6fdd96253312d5a (patch)
tree92a687c1e9267e89bdd4ebc0b558d6ed2e70452d
parent86e23f74da247cd661c69e4bb1a5327001cc3317 (diff)
downloadegawk-6023b5f57f8b4869d75dd43ea6fdd96253312d5a.tar.gz
egawk-6023b5f57f8b4869d75dd43ea6fdd96253312d5a.tar.bz2
egawk-6023b5f57f8b4869d75dd43ea6fdd96253312d5a.zip
Sync getopt with GLIBC.
-rw-r--r--ChangeLog4
-rw-r--r--getopt.c8
2 files changed, 8 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index b7beff3a..072c32e3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -7,6 +7,10 @@
* configh.in, configure: Regenerated due to change in m4/readline.m4.
Issue reported by Hermann Peifer and Larry Baker.
+ Unrelated:
+
+ * getopt.c: Sync with GLIBC, changes are minor.
+
2013-08-26 Arnold D. Robbins <arnold@skeeve.com>
* regcomp.c (parse_dup_op): Remove RE_TOKEN_INIT_BUG code (change of
diff --git a/getopt.c b/getopt.c
index 7679991d..bab52a05 100644
--- a/getopt.c
+++ b/getopt.c
@@ -236,7 +236,7 @@ exchange (char **argv, struct _getopt_data *d)
{
/* Bottom segment is the short one. */
int len = middle - bottom;
- register int i;
+ int i;
/* Swap it with the top part of the top segment. */
for (i = 0; i < len; i++)
@@ -253,7 +253,7 @@ exchange (char **argv, struct _getopt_data *d)
{
/* Top segment is the short one. */
int len = top - middle;
- register int i;
+ int i;
/* Swap it with the bottom part of the bottom segment. */
for (i = 0; i < len; i++)
@@ -574,8 +574,8 @@ _getopt_internal_r (int argc, char *const *argv, const char *optstring,
|| pfound->flag != p->flag
|| pfound->val != p->val)
{
- /* Second or later nonexact match found. */
- struct option_list *newp = malloc (sizeof (*newp));
+ /* Second or later nonexact match found. */
+ struct option_list *newp = alloca (sizeof (*newp));
newp->p = p;
newp->needs_free = 1;
newp->next = ambig_list;