From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1172 invoked by alias); 21 Feb 2010 15:09:49 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 27732 Received: (qmail 1237 invoked from network); 21 Feb 2010 15:09:48 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS autolearn=ham version=3.2.5 Received-SPF: none (ns1.primenet.com.au: domain at bewatermyfriend.org does not designate permitted sender hosts) From: Frank Terbeck To: zsh-workers@zsh.org Subject: PATCH: Disable WARN_CREATE_GLOBAL in 'zstyle -e' code Date: Sun, 21 Feb 2010 16:09:45 +0100 Message-Id: <1266764985-20371-1-git-send-email-ft@bewatermyfriend.org> X-Mailer: git-send-email 1.7.0 In-Reply-To: <1266764004-15068-1-git-send-email-ft@bewatermyfriend.org> References: <1266764004-15068-1-git-send-email-ft@bewatermyfriend.org> X-Df-Sender: 430444 [...] > c) Disable `warn_create_global' in code executed by "zstyle -e". Or > make `reply' and `REPLY' special in that case. Or whatever makes the > most sense. > > This patch does what "a)" suggests, basically because it works and I was > lazy. I think "c)" would be the cleanest solution, but I don't know if > that's doable and I haven't looked at the involved code yet. [...] This does "c)". I think this shouldn't break anything. So, I think it's correct and should be preferable to setting NO_warn_create_global in vcs_info. Regards, Frank --- Src/Modules/zutil.c | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/Src/Modules/zutil.c b/Src/Modules/zutil.c index 698b7e3..2d8c61a 100644 --- a/Src/Modules/zutil.c +++ b/Src/Modules/zutil.c @@ -340,15 +340,22 @@ static char ** evalstyle(Stypat p) { int ef = errflag; + int reset = 0; char **ret, *str; unsetparam("reply"); + if (isset(WARNCREATEGLOBAL)) { + reset = 1; + dosetopt(WARNCREATEGLOBAL, 0, 0); + } execode(p->eval, 1, 0); if (errflag) { errflag = ef; return NULL; } errflag = ef; + if (reset) + dosetopt(WARNCREATEGLOBAL, 1, 0); queue_signals(); if ((ret = getaparam("reply"))) -- 1.7.0