[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gawk-diffs] [SCM] gawk branch, gawk-4.0-stable, updated. 86d47bad93db00
From: |
Arnold Robbins |
Subject: |
[gawk-diffs] [SCM] gawk branch, gawk-4.0-stable, updated. 86d47bad93db0031e87f09afabaceebd90ffea02 |
Date: |
Sat, 03 Sep 2011 19:39:20 +0000 |
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "gawk".
The branch, gawk-4.0-stable has been updated
via 86d47bad93db0031e87f09afabaceebd90ffea02 (commit)
from cfba2eb6f221d0f94643a57c135c62f5bc66ee10 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=86d47bad93db0031e87f09afabaceebd90ffea02
commit 86d47bad93db0031e87f09afabaceebd90ffea02
Author: Arnold D. Robbins <address@hidden>
Date: Sat Sep 3 22:39:04 2011 +0300
Sync again with GNU grep.
diff --git a/ChangeLog b/ChangeLog
index c0311bb..924ef82 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2011-09-03 Arnold D. Robbins <address@hidden>
+
+ * dfa.c: Sync with GNU grep.
+
2011-08-24 Arnold D. Robbins <address@hidden>
Fix pty co-process communication on Ubuntu GNU/Linux.
diff --git a/dfa.c b/dfa.c
index 71c70d8..02bdd89 100644
--- a/dfa.c
+++ b/dfa.c
@@ -3646,20 +3646,12 @@ static char *
icatalloc (char *old, char const *new)
{
char *result;
- size_t oldsize, newsize;
-
- newsize = (new == NULL) ? 0 : strlen(new);
- if (old == NULL)
- oldsize = 0;
- else if (newsize == 0)
+ size_t oldsize = old == NULL ? 0 : strlen (old);
+ size_t newsize = new == NULL ? 0 : strlen (new);
+ if (newsize == 0)
return old;
- else oldsize = strlen(old);
- if (old == NULL)
- result = malloc(newsize + 1);
- else
- result = realloc(old, oldsize + newsize + 1);
- if (result != NULL && new != NULL)
- strcpy(result + oldsize, new);
+ result = xrealloc (old, oldsize + newsize + 1);
+ strcpy (result + oldsize, new);
return result;
}
@@ -3767,8 +3759,16 @@ comsubs (char *left, char const *right)
}
if (len == 0)
continue;
- if ((cpp = enlist(cpp, lcp, len)) == NULL)
- break;
+ {
+ char **p = enlist (cpp, lcp, len);
+ if (p == NULL)
+ {
+ freelist (cpp);
+ cpp = NULL;
+ break;
+ }
+ cpp = p;
+ }
}
return cpp;
}
@@ -3861,13 +3861,10 @@ dfamust (struct dfa *d)
mp[i] = must0;
for (i = 0; i <= d->tindex; ++i)
{
- mp[i].in = malloc(sizeof *mp[i].in);
- mp[i].left = malloc(2);
- mp[i].right = malloc(2);
- mp[i].is = malloc(2);
- if (mp[i].in == NULL || mp[i].left == NULL ||
- mp[i].right == NULL || mp[i].is == NULL)
- goto done;
+ mp[i].in = xmalloc(sizeof *mp[i].in);
+ mp[i].left = xmalloc(2);
+ mp[i].right = xmalloc(2);
+ mp[i].is = xmalloc(2);
mp[i].left[0] = mp[i].right[0] = mp[i].is[0] = '\0';
mp[i].in[0] = NULL;
}
@@ -3974,13 +3971,8 @@ dfamust (struct dfa *d)
char *tp;
tp = icpyalloc(lmp->right);
- if (tp == NULL)
- goto done;
tp = icatalloc(tp, rmp->left);
- if (tp == NULL)
- goto done;
- lmp->in = enlist(lmp->in, tp,
- strlen(tp));
+ lmp->in = enlist(lmp->in, tp, strlen(tp));
free(tp);
if (lmp->in == NULL)
goto done;
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 4 ++++
dfa.c | 48 ++++++++++++++++++++----------------------------
2 files changed, 24 insertions(+), 28 deletions(-)
hooks/post-receive
--
gawk
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [gawk-diffs] [SCM] gawk branch, gawk-4.0-stable, updated. 86d47bad93db0031e87f09afabaceebd90ffea02,
Arnold Robbins <=