shell: tweak bkslash_in_varexp.tests, add bkslash_in_varexp1.tests

It turns out bkslash_in_varexp.tests was a bash bug :]

ash and hush fail "corrected" bkslash_in_varexp.tests as well,
just not as badly as I thought (hush gets half of the cases right).

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko
2018-03-02 18:12:12 +01:00
parent 744a20d8f9
commit 55f8133a4f
8 changed files with 50 additions and 5 deletions

View File

@@ -71,9 +71,11 @@ char* FAST_FUNC scan_and_match(char *string, const char *pattern, unsigned flags
if (flags & SCAN_MATCH_LEFT_HALF) {
*loc = '\0';
r = fnmatch(pattern, string, 0);
//bb_error_msg("fnmatch('%s','%s',0):%d", pattern, string, r);
*loc = c;
} else {
r = fnmatch(pattern, loc, 0);
//bb_error_msg("fnmatch('%s','%s',0):%d", pattern, string, r);
}
if (r == 0) /* match found */
return loc;