- Timestamp:
- Apr 30, 2007, 1:15:23 AM (18 years ago)
- Location:
- trunk/essentials/app-shells/bash
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/essentials/app-shells/bash/parse.y
r3236 r3245 2719 2719 #define P_DQUOTE 0x04 2720 2720 #define P_COMMAND 0x08 /* parsing a command, so look for comments */ 2721 #define P_BACKQUOTE 0x10 /* parsing a backquoted command substitution */ 2721 2722 2722 2723 static char matched_pair_error; … … 2728 2729 { 2729 2730 int count, ch, was_dollar, in_comment, check_comment; 2730 int pass_next_character, nestlen, ttranslen, start_lineno;2731 int pass_next_character, backq_backslash, nestlen, ttranslen, start_lineno; 2731 2732 char *ret, *nestret, *ttrans; 2732 2733 int retind, retsize, rflags; 2733 2734 2734 2735 count = 1; 2735 pass_next_character = was_dollar = in_comment = 0;2736 pass_next_character = backq_backslash = was_dollar = in_comment = 0; 2736 2737 check_comment = (flags & P_COMMAND) && qc != '\'' && qc != '"' && (flags & P_DQUOTE) == 0; 2737 2738 … … 2745 2746 while (count) 2746 2747 { 2747 #if 0 2748 ch = shell_getc ((qc != '\'' || (flags & P_ALLOWESC)) && pass_next_character == 0); 2749 #else 2750 ch = shell_getc (qc != '\'' && pass_next_character == 0); 2751 #endif 2748 ch = shell_getc (qc != '\'' && pass_next_character == 0 && backq_backslash == 0); 2749 2752 2750 if (ch == EOF) 2753 2751 { … … 2774 2772 } 2775 2773 /* Not exactly right yet */ 2776 else if (check_comment && in_comment == 0 && ch == '#' && (retind == 0 || ret[retind-1] == '\n' || whitespace (ret[retind -1])))2774 else if MBTEST(check_comment && in_comment == 0 && ch == '#' && (retind == 0 || ret[retind-1] == '\n' || whitespace (ret[retind - 1]))) 2777 2775 in_comment = 1; 2776 2777 /* last char was backslash inside backquoted command substitution */ 2778 if (backq_backslash) 2779 { 2780 backq_backslash = 0; 2781 /* Placeholder for adding special characters */ 2782 } 2778 2783 2779 2784 if (pass_next_character) /* last char was backslash */ … … 2817 2822 if MBTEST((flags & P_ALLOWESC) && ch == '\\') 2818 2823 pass_next_character++; 2824 else if MBTEST((flags & P_BACKQUOTE) && ch == '\\') 2825 backq_backslash++; 2819 2826 continue; 2820 2827 } … … 2901 2908 else if MBTEST(qc == '`' && (ch == '"' || ch == '\'') && in_comment == 0) 2902 2909 { 2903 nestret = parse_matched_pair (0, ch, ch, &nestlen, rflags); 2910 /* Add P_BACKQUOTE so backslash quotes the next character and 2911 shell_getc does the right thing with \<newline>. We do this for 2912 a measure of backwards compatibility -- it's not strictly the 2913 right POSIX thing. */ 2914 nestret = parse_matched_pair (0, ch, ch, &nestlen, rflags|P_BACKQUOTE); 2904 2915 goto add_nestret; 2905 2916 } -
trunk/essentials/app-shells/bash/patchlevel.h
r3244 r3245 26 26 looks for to find the patch level (for the sccs version string). */ 27 27 28 #define PATCHLEVEL 928 #define PATCHLEVEL 10 29 29 30 30 #endif /* _PATCHLEVEL_H_ */
Note:
See TracChangeset
for help on using the changeset viewer.