summaryrefslogtreecommitdiff
path: root/tests/diff/patch.c
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2019-06-07 09:17:23 +0200
committerPatrick Steinhardt <ps@pks.im>2019-06-13 10:45:55 +0200
commiteb146e58664428d9e23bc84e0e9f75db7924ae37 (patch)
treec5262cf87de2e6a0c7229cb8b2e89ef6fa400a86 /tests/diff/patch.c
parentf7c6795f48850eec94793d22b5fd621b61cd2466 (diff)
downloadlibgit2-eb146e58664428d9e23bc84e0e9f75db7924ae37.tar.gz
attr_file: properly handle escaped '\' when searching non-escaped spaces
When parsing attributes, we need to search for the first unescaped whitespace character to determine where the pattern is to be cut off. The scan fails to account for the case where the escaping '\' character is itself escaped, though, and thus we would not recognize the cut-off point in patterns like "\\ ". Refactor the scanning loop to remember whether the last character was an escape character. If it was and the next character is a '\', too, then we will reset to non-escaped mode again. Thus, we now handle escaped whitespaces as well as escaped wildcards correctly.
Diffstat (limited to 'tests/diff/patch.c')
0 files changed, 0 insertions, 0 deletions