svn commit: trunk/busybox/shell: hush_test hush_test/hush-glob hush_test etc...

vda at busybox.net vda at busybox.net
Tue Jun 10 20:13:40 UTC 2008


Author: vda
Date: 2008-06-10 13:13:40 -0700 (Tue, 10 Jun 2008)
New Revision: 22287

Log:
hush: fix escaping of \[*?; add testsuites for these and for globbing



Added:
   trunk/busybox/shell/hush_test/hush-glob/
   trunk/busybox/shell/hush_test/hush-glob/glob1.right
   trunk/busybox/shell/hush_test/hush-glob/glob1.tests
   trunk/busybox/shell/hush_test/hush-parsing/escape1.right
   trunk/busybox/shell/hush_test/hush-parsing/escape1.tests
   trunk/busybox/shell/hush_test/hush-parsing/escape2.right
   trunk/busybox/shell/hush_test/hush-parsing/escape2.tests

Modified:
   trunk/busybox/shell/hush.c


Changeset:
Modified: trunk/busybox/shell/hush.c
===================================================================
--- trunk/busybox/shell/hush.c	2008-06-10 18:30:43 UTC (rev 22286)
+++ trunk/busybox/shell/hush.c	2008-06-10 20:13:40 UTC (rev 22287)
@@ -3638,7 +3638,6 @@
 				debug_printf_parse("parse_stream return 1: \\<eof>\n");
 				return 1;
 			}
-			o_addqchr(dest, '\\', dest->o_quote);
 			o_addqchr(dest, i_getch(input), dest->o_quote);
 			break;
 		case '$':
@@ -3653,7 +3652,7 @@
 				ch = i_getch(input);
 				if (ch == EOF || ch == '\'')
 					break;
-				o_addchr(dest, ch);
+				o_addqchr(dest, ch, 1);
 			}
 			if (ch == EOF) {
 				syntax("unterminated '");

Added: trunk/busybox/shell/hush_test/hush-glob/glob1.right
===================================================================
--- trunk/busybox/shell/hush_test/hush-glob/glob1.right	                        (rev 0)
+++ trunk/busybox/shell/hush_test/hush-glob/glob1.right	2008-06-10 20:13:40 UTC (rev 22287)
@@ -0,0 +1,2 @@
+glob1.tests
+glob1.tests

Added: trunk/busybox/shell/hush_test/hush-glob/glob1.tests
===================================================================
--- trunk/busybox/shell/hush_test/hush-glob/glob1.tests	                        (rev 0)
+++ trunk/busybox/shell/hush_test/hush-glob/glob1.tests	2008-06-10 20:13:40 UTC (rev 22287)
@@ -0,0 +1,2 @@
+echo *glob1?t[e]sts*
+echo "glob1"?'t'[e]s*


Property changes on: trunk/busybox/shell/hush_test/hush-glob/glob1.tests
___________________________________________________________________
Name: svn:executable
   + *

Added: trunk/busybox/shell/hush_test/hush-parsing/escape1.right
===================================================================
--- trunk/busybox/shell/hush_test/hush-parsing/escape1.right	                        (rev 0)
+++ trunk/busybox/shell/hush_test/hush-parsing/escape1.right	2008-06-10 20:13:40 UTC (rev 22287)
@@ -0,0 +1,4 @@
+\
+a\b
+\\
+c\\d

Added: trunk/busybox/shell/hush_test/hush-parsing/escape1.tests
===================================================================
--- trunk/busybox/shell/hush_test/hush-parsing/escape1.tests	                        (rev 0)
+++ trunk/busybox/shell/hush_test/hush-parsing/escape1.tests	2008-06-10 20:13:40 UTC (rev 22287)
@@ -0,0 +1,4 @@
+echo "\\"
+echo a"\\"b
+echo '\\'
+echo c'\\'d


Property changes on: trunk/busybox/shell/hush_test/hush-parsing/escape1.tests
___________________________________________________________________
Name: svn:executable
   + *

Added: trunk/busybox/shell/hush_test/hush-parsing/escape2.right
===================================================================
--- trunk/busybox/shell/hush_test/hush-parsing/escape2.right	                        (rev 0)
+++ trunk/busybox/shell/hush_test/hush-parsing/escape2.right	2008-06-10 20:13:40 UTC (rev 22287)
@@ -0,0 +1,4 @@
+*?[a]*
+a*?[a]*b
+*?[a]*
+c*?[a]*d

Added: trunk/busybox/shell/hush_test/hush-parsing/escape2.tests
===================================================================
--- trunk/busybox/shell/hush_test/hush-parsing/escape2.tests	                        (rev 0)
+++ trunk/busybox/shell/hush_test/hush-parsing/escape2.tests	2008-06-10 20:13:40 UTC (rev 22287)
@@ -0,0 +1,4 @@
+echo "*?[a]*"
+echo a"*?[a]*"b
+echo '*?[a]*'
+echo c'*?[a]*'d


Property changes on: trunk/busybox/shell/hush_test/hush-parsing/escape2.tests
___________________________________________________________________
Name: svn:executable
   + *




More information about the busybox-cvs mailing list