From 946e17b87e0b612b95abe3deb6bc126b0992b165 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Thu, 10 Jun 2010 16:37:52 -0400 Subject: [PATCH] Do not override value of keepopen global, instead restore it to the value we pushed onto the stack when popping. --HG-- branch : 1.7 --- toke.c | 2 +- toke.l | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/toke.c b/toke.c index 337c42c90..4875fb098 100644 --- 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 4437d7d76..f589f2bd8 100644 --- 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); } -- 2.40.0