aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Bennett <steveb@workware.net.au>2011-06-14 10:42:55 +1000
committerSteve Bennett <steveb@workware.net.au>2011-07-07 21:34:34 +1000
commitd72dac96e1e6fba8153b5c38c698b0fe487b939f (patch)
tree72a8bb71af2f4909c39e7b5aac6f9cfdce64bb91
parente6eebd6b8822ce954a864cb3b02799b53ec7fec3 (diff)
downloadjimtcl-d72dac96e1e6fba8153b5c38c698b0fe487b939f.zip
jimtcl-d72dac96e1e6fba8153b5c38c698b0fe487b939f.tar.gz
jimtcl-d72dac96e1e6fba8153b5c38c698b0fe487b939f.tar.bz2
Minor code cleanups
Some unused variables Signed-off-by: Steve Bennett <steveb@workware.net.au>
-rw-r--r--jim-exec.c19
-rw-r--r--jimregexp.c10
2 files changed, 12 insertions, 17 deletions
diff --git a/jim-exec.c b/jim-exec.c
index 5c9b49f..4315cd7 100644
--- a/jim-exec.c
+++ b/jim-exec.c
@@ -865,15 +865,6 @@ badargs:
(void)signal(SIGPIPE, SIG_IGN);
}
- /*
- * Enlarge the wait table if there isn't enough space for a new
- * entry.
- */
- if (table->used == table->size) {
- table->size += WAIT_TABLE_GROW_BY;
- table->info = Jim_Realloc(table->info, table->size * sizeof(*table->info));
- }
-
/* Need to do this befor vfork() */
if (pipe_dup_err) {
errorId = outputId;
@@ -911,6 +902,16 @@ badargs:
}
/* parent */
+
+ /*
+ * Enlarge the wait table if there isn't enough space for a new
+ * entry.
+ */
+ if (table->used == table->size) {
+ table->size += WAIT_TABLE_GROW_BY;
+ table->info = Jim_Realloc(table->info, table->size * sizeof(*table->info));
+ }
+
table->info[table->used].pid = pid;
table->info[table->used].flags = 0;
table->used++;
diff --git a/jimregexp.c b/jimregexp.c
index 141db92..b138cb1 100644
--- a/jimregexp.c
+++ b/jimregexp.c
@@ -1269,14 +1269,11 @@ static int regmatchsimplerepeat(regex_t *preg, int scan, int matchmin)
static int regmatchrepeat(regex_t *preg, int scan, int matchmin)
{
- const char *save;
int *scanpt = preg->program + scan;
int max = scanpt[2];
int min = scanpt[3];
- save = preg->reginput;
-
/* Have we reached min? */
if (scanpt[4] < min) {
/* No, so get another one */
@@ -1305,7 +1302,6 @@ static int regmatchrepeat(regex_t *preg, int scan, int matchmin)
return 0;
}
/* maximal, so try this branch again */
- save = preg->reginput;
if (scanpt[4] < max) {
scanpt[4]++;
if (regmatch(preg, scan + 5)) {
@@ -1313,10 +1309,8 @@ static int regmatchrepeat(regex_t *preg, int scan, int matchmin)
}
scanpt[4]--;
}
- /* At this point we are at max with no match. Back up by one and try the other branch */
- preg->reginput = save;
- int ret = regmatch(preg, regnext(preg, scan));
- return ret;
+ /* At this point we are at max with no match. Try the other branch */
+ return regmatch(preg, regnext(preg, scan));
}
/*