cmd/tests: Fix "broken" handling when expected line is empty
Frédéric Delanoy
frederic.delanoy at gmail.com
Tue Aug 2 06:01:29 CDT 2011
---
programs/cmd/tests/batch.c | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/programs/cmd/tests/batch.c b/programs/cmd/tests/batch.c
index 84d7f39..6a750dc 100644
--- a/programs/cmd/tests/batch.c
+++ b/programs/cmd/tests/batch.c
@@ -152,6 +152,16 @@ static const char *compare_line(const char *out_line, const char *out_end, const
static const char space_cmd[] = {'@','s','p','a','c','e','@'};
static const char or_broken_cmd[] = {'@','o','r','_','b','r','o','k','e','n','@'};
+ /* Corner case where exp_line directly starts with @or_broken@ */
+ if(broken(1)
+ && exp_line+sizeof(or_broken_cmd) <= exp_end
+ && !memcmp(exp_line, or_broken_cmd, sizeof(or_broken_cmd))) {
+ if(out_line == out_end)
+ return NULL;
+ else
+ goto brokenHandling;
+ }
+
while(exp_ptr < exp_end) {
if(*exp_ptr == '@') {
if(exp_ptr+sizeof(pwd_cmd) <= exp_end
@@ -185,6 +195,7 @@ static const char *compare_line(const char *out_line, const char *out_end, const
if(!broken(1))
return err;
+brokenHandling:
while(exp_ptr+sizeof(or_broken_cmd) <= exp_end && memcmp(exp_ptr, or_broken_cmd, sizeof(or_broken_cmd)))
exp_ptr++;
if(!exp_ptr)
--
1.7.6
More information about the wine-patches
mailing list