cmd/tests: Fix "broken" handling when expected line is empty.

This commit is contained in:
Frédéric Delanoy 2011-08-02 22:55:37 +02:00 committed by Alexandre Julliard
parent 6990cdfe96
commit bde872e782
1 changed files with 10 additions and 0 deletions

View File

@ -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@, on Windowses */
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
exp_ptr = exp_line + sizeof(or_broken_cmd);
}
while(exp_ptr < exp_end) {
if(*exp_ptr == '@') {
if(exp_ptr+sizeof(pwd_cmd) <= exp_end