[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    bug#1174: [BusyBox] bug#1174: multiple busybox bugs. init, mv (minor), sh
From:       "Vladimir N. Oleynik" <dzo () simtreas ! ru>
Date:       2001-05-31 10:45:02
[Download RAW message or body]

Adam,

> 3) sh (same bug? multiple bugs? i dunno.)
> 
> I didn't look into the source code for this one since I don't have an
> immediate need for it to be fixed.  cp doesn't seem to like to copy
> directories with spaces in the names. Also echo doesn't seem to like to
> write to files with spaces in the name.
> 
> Autocompletion has a small problem too. If you use autocomplete on a
> file/dir with spaces it automatically inserts a '\'. This is good.
> However, if you try and use autocompletion and use a quote at the
> beginning it will STILL insert the '\'. This is bad. Try:
> 
> # touch "as df"
> # ls as<tab>
>   -- Looks good so far. --
> # ls "as<tab>
>   -- ah. damnit. definately not what should have happened. --
> 
> Again, I didn't even look in the source code for the auto completion
> stuff, so I really don't have any suggested fixes for this.

ok.
New variant:
# touch "as df"
# ls as<tab>
   -- Looks good so far. --
# ls as \ df

Right?
This variant also smalest! ;)
Patch in attach.


--w
vodz
["bug1174cmdedit.patch" (text/plain)]

--- busybox.orig/cmdedit.c	Thu May 31 11:57:44 2001
+++ busybox/cmdedit.c	Thu May 31 20:30:17 2001
@@ -983,17 +983,14 @@
 			 || (int_buf[i + 1] & ~QUOT) == '~')) {
 		i++;
 	}
-	if (i) {
-		collapse_pos(0, i);
-	}
 
 	/* set only match and destroy quotes */
 	j = 0;
-	for (i = 0; pos_buf[i] >= 0; i++) {
-		matchBuf[i] = matchBuf[pos_buf[i]];
+	for (c = 0; pos_buf[i] >= 0; i++) {
+		matchBuf[c++] = matchBuf[pos_buf[i]];
 		j = pos_buf[i] + 1;
 	}
-	matchBuf[i] = 0;
+	matchBuf[c] = 0;
 	/* old lenght matchBuf with quotes symbols */
 	*len_with_quotes = j ? j - pos_buf[0] : 0;
 
@@ -1097,8 +1094,7 @@
 			/* new len                         */
 			len = strlen(command_ps);
 			/* write out the matched command   */
-			input_end();
-			input_backward(cursor - recalc_pos);
+			redraw(cmdedit_y, len - recalc_pos);
 		}
 		if (tmp != matches[0])
 			free(tmp);


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic