FW: [01/16] cmd.exe: Add "if defined ..." support
Ann & Jason Edmeades
us at edmeades.me.uk
Tue Feb 20 11:47:35 CST 2007
Resending missing ones - they seem to have vanished into thin air
-----Original Message-----
From: Ann & Jason Edmeades [mailto:us at edmeades.me.uk]
Sent: 20 February 2007 00:32
To: 'wine-patches at winehq.org'
Subject: [01/16] cmd.exe: Add "if defined ..." support
-------------- next part --------------
>From nobody Mon Sep 17 00:00:00 2001
From: Jason Edmeades <us at edmeades.me.uk>
Date: Tue Feb 13 21:40:33 2007 +0000
Subject: [PATCH] Add if defined support to cmd.exe
---
programs/cmd/builtins.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
mode change 100644 => 100755 programs/cmd/builtins.c
06a0aecc72a0c3f606427831aed780e7741049e8
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;
--
1.3.0
More information about the wine-patches
mailing list