Commit eb146e5
committed
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.1 parent f7c6795 commit eb146e5
1 file changed
+16
-14
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
587 | 587 | | |
588 | 588 | | |
589 | 589 | | |
| 590 | + | |
590 | 591 | | |
591 | 592 | | |
592 | 593 | | |
| |||
623 | 624 | | |
624 | 625 | | |
625 | 626 | | |
| 627 | + | |
| 628 | + | |
626 | 629 | | |
627 | | - | |
628 | | - | |
629 | | - | |
630 | | - | |
631 | | - | |
632 | | - | |
633 | | - | |
634 | | - | |
635 | | - | |
| 630 | + | |
636 | 631 | | |
637 | | - | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
638 | 639 | | |
639 | 640 | | |
640 | 641 | | |
641 | 642 | | |
642 | 643 | | |
643 | | - | |
644 | | - | |
645 | | - | |
646 | | - | |
| 644 | + | |
| 645 | + | |
647 | 646 | | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
648 | 650 | | |
649 | 651 | | |
650 | 652 | | |
| |||
0 commit comments