wcmd: Don't execute non-empty commands

Juan Lang juan.lang at gmail.com
Wed Aug 12 20:16:14 CDT 2009


Fixes bug 19407 in a way more consistent with the rest of the code:
the caller checks whether the command exists before calling
WCMD_execute.
--Juan
-------------- next part --------------
From edcd9f66d3114968eaa1e5481178d5736ca11037 Mon Sep 17 00:00:00 2001
From: Juan Lang <juan.lang at gmail.com>
Date: Wed, 12 Aug 2009 18:15:37 -0700
Subject: [PATCH 11/11] Only execute non-empty commands

---
 programs/cmd/builtins.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/programs/cmd/builtins.c b/programs/cmd/builtins.c
index 0e99f52..b544a37 100644
--- a/programs/cmd/builtins.c
+++ b/programs/cmd/builtins.c
@@ -1061,7 +1061,7 @@ void WCMD_part_execute(CMD_LIST **cmdList, WCHAR *firstcmd, WCHAR *variable,
       /* FIXME: Only if previous call worked for && or failed for || */
       if ((*cmdList)->prevDelim == CMD_ONFAILURE ||
           (*cmdList)->prevDelim != CMD_ONSUCCESS) {
-        if (processThese) {
+        if (processThese && (*cmdList)->command) {
           WCMD_execute ((*cmdList)->command, (*cmdList)->redirects, variable,
                         value, cmdList);
         }
-- 
1.6.3.2


More information about the wine-patches mailing list