]> granicus.if.org Git - sudo/commitdiff
Do not override value of keepopen global, instead restore it to the
authorTodd C. Miller <Todd.Miller@courtesan.com>
Thu, 10 Jun 2010 20:37:52 +0000 (16:37 -0400)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Thu, 10 Jun 2010 20:37:52 +0000 (16:37 -0400)
value we pushed onto the stack when popping.

--HG--
branch : 1.7

toke.c
toke.l

diff --git a/toke.c b/toke.c
index 337c42c906e40a90f437cec1bec43b096bf2b3c5..4875fb098a1e94ba58108b66548a4b0cc215fa01 100644 (file)
--- a/toke.c
+++ b/toke.c
@@ -3539,7 +3539,6 @@ pop_include()
     if (!keepopen)
        fclose(YY_CURRENT_BUFFER->yy_input_file);
     yy_delete_buffer(YY_CURRENT_BUFFER);
-    keepopen = FALSE;
     /* If we are in an include dir, move to the next file. */
     while ((pl = istack[idepth - 1].more) != NULL) {
        fp = open_sudoers(pl->path, FALSE, &keepopen);
@@ -3564,6 +3563,7 @@ pop_include()
        efree(sudoers);
        sudoers = istack[idepth].path;
        sudolineno = istack[idepth].lineno;
+       keepopen = istack[idepth].keepopen;
     }
     return(TRUE);
 }
diff --git a/toke.l b/toke.l
index 4437d7d767778f7c4297bba420ce1c8070391645..f589f2bd8d796428c6d66aadcbd3aed0b8359440 100644 (file)
--- a/toke.l
+++ b/toke.l
@@ -918,7 +918,6 @@ pop_include()
     if (!keepopen)
        fclose(YY_CURRENT_BUFFER->yy_input_file);
     yy_delete_buffer(YY_CURRENT_BUFFER);
-    keepopen = FALSE;
     /* If we are in an include dir, move to the next file. */
     while ((pl = istack[idepth - 1].more) != NULL) {
        fp = open_sudoers(pl->path, FALSE, &keepopen);
@@ -943,6 +942,7 @@ pop_include()
        efree(sudoers);
        sudoers = istack[idepth].path;
        sudolineno = istack[idepth].lineno;
+       keepopen = istack[idepth].keepopen;
     }
     return(TRUE);
 }