summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorherbert <herbert@gondor.apana.org.au>2004-08-18 21:24:11 +1000
committerHerbert Xu <herbert@gondor.apana.org.au>2005-09-26 18:33:02 +1000
commitf1cbb2a734f46279ad3fa942978d29d9cf25978c (patch)
treeeac61cde98ddd4bfbd26b5454085e0140ea443c7 /src
parentAllow negative pid argument to kill(1) in src/jobs.c. (diff)
downloaddash-f1cbb2a734f46279ad3fa942978d29d9cf25978c.tar.gz
dash-f1cbb2a734f46279ad3fa942978d29d9cf25978c.zip
Fixed expansion when leading argument is null in src/expand.c.
Diffstat (limited to 'src')
-rw-r--r--src/expand.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/expand.c b/src/expand.c
index 800011e..b2800c6 100644
--- a/src/expand.c
+++ b/src/expand.c
@@ -976,9 +976,12 @@ param:
 			size_t partlen;
 
 			partlen = strlen(p);
-
 			len += partlen;
-			if (len > partlen && sep) {
+
+			if (!(subtype == VSPLUS || subtype == VSLENGTH))
+				memtodest(p, partlen, syntax, quotes);
+
+			if (*ap && sep) {
 				char *q;
 
 				len++;
@@ -991,9 +994,6 @@ param:
 				STPUTC(sep, q);
 				expdest = q;
 			}
-
-			if (!(subtype == VSPLUS || subtype == VSLENGTH))
-				memtodest(p, partlen, syntax, quotes);
 		}
 		return len;
 	case '0':
3&follow=1'>Replace nerdcommenter with vim-commentaryJune McEnroe 2013-03-24Add paredit.vimJune McEnroe 2013-03-14Update base16-vimJune McEnroe It's still crap 2013-03-12Hide mode from below statuslineJune McEnroe 2013-03-12Switch to powerlineJune McEnroe Which I'm not going to bother configuring because it thinks it's all fancy and for other things that aren't Vim so it stores its config file in ~/.config which I keep in a different repo and I only want to use it for Vim so fuck you, Powerline. </rant> 2013-03-12Remove vim-powerlineJune McEnroe 2013-02-03Update base16 and refheapJune McEnroe 2013-02-03Ignore plugin/private.vimJune McEnroe 2012-09-29Disable GUI dialogsJune McEnroe