Jason Edmeades : cmd.exe: Add "if defined ..." support.

Alexandre Julliard julliard at wine.codeweavers.com
Wed Feb 21 06:01:05 CST 2007


Module: wine
Branch: master
Commit: 758a3977558f164e205e5683f138fc0ec21a7791
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=758a3977558f164e205e5683f138fc0ec21a7791

Author: Jason Edmeades <us at edmeades.me.uk>
Date:   Tue Feb 20 17:47:35 2007 +0000

cmd.exe: Add "if defined ..." support.

---

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

diff --git a/programs/cmd/builtins.c b/programs/cmd/builtins.c
old mode 100644
new mode 100755
index 49548de..8715835
--- a/programs/cmd/builtins.c
+++ b/programs/cmd/builtins.c
@@ -472,6 +472,12 @@ char condition[MAX_PATH], *command, *s;
     }
     WCMD_parameter (p, 2+negate, &command);
   }
+  else if (!lstrcmpi (condition, "defined")) {
+    if (GetEnvironmentVariableA(WCMD_parameter (p, 1+negate, NULL), NULL, 0) > 0) {
+        test = 1;
+    }
+    WCMD_parameter (p, 2+negate, &command);
+  }
   else if ((s = strstr (p, "=="))) {
     s += 2;
     if (!lstrcmpi (condition, WCMD_parameter (s, 0, NULL))) test = 1;




More information about the wine-cvs mailing list