svn commit: [26159] trunk/busybox/shell
vda at busybox.net
vda at busybox.net
Sun Apr 19 14:03:12 UTC 2009
Author: vda
Date: 2009-04-19 14:03:11 +0000 (Sun, 19 Apr 2009)
New Revision: 26159
Log:
same as previous, but -100 bytes
Modified:
trunk/busybox/shell/hush.c
Changeset:
Modified: trunk/busybox/shell/hush.c
===================================================================
--- trunk/busybox/shell/hush.c 2009-04-19 13:57:51 UTC (rev 26158)
+++ trunk/busybox/shell/hush.c 2009-04-19 14:03:11 UTC (rev 26159)
@@ -5476,22 +5476,24 @@
* will still trigger for us */
}
}
+
+ /* "cmd}" or "cmd }..." without semicolon or &:
+ * } is an ordinary char in this case, even inside { cmd; }
+ * Pathological example: { ""}; } should exec "}" cmd
+ */
+ if (ch == '}'
+ && !(IS_NULL_PIPE(ctx.pipe)
+ && IS_NULL_CMD(ctx.command)
+ && dest.length == 0
+ && !dest.o_quoted
+ )
+ ) {
+ goto ordinary_char;
+ }
+
if (end_trigger && end_trigger == ch
&& (heredoc_cnt == 0 || end_trigger != ';')
) {
- /* "{ cmd}" or "{ cmd }..." without semicolon or &:
- * } is an ordinary char in this case.
- * Pathological example: { ""}; } should exec "}" cmd
- */
- if (ch == '}'
- && !(IS_NULL_PIPE(ctx.pipe)
- && IS_NULL_CMD(ctx.command)
- && dest.length == 0
- && !dest.o_quoted
- )
- ) {
- goto ordinary_char;
- }
if (heredoc_cnt) {
/* This is technically valid:
* { cat <<HERE; }; echo Ok
@@ -5757,16 +5759,6 @@
goto case_semi;
#endif
case '}':
- if (!(IS_NULL_PIPE(ctx.pipe)
- && IS_NULL_CMD(ctx.command)
- && dest.length == 0
- && !dest.o_quoted
- )
- ) {
- /* } not preceded by ; or & is an ordinary
- * char, example: "echo }" */
- goto ordinary_char;
- }
/* proper use of this character is caught by end_trigger:
* if we see {, we call parse_group(..., end_trigger='}')
* and it will match } earlier (not here). */
More information about the busybox-cvs
mailing list