summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
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':
n/shotty.c?id=de9409e3888ba92b0dca38ac81fe3e4b17e7f466&follow=1'>Use -s to infer terminal sizeJune McEnroe 2019-07-12Add DCH to shottyJune McEnroe 2019-07-12Support insert mode in shottyJune McEnroe 2019-07-11Don't do carriage return on line feedJune McEnroe 2019-07-11Interpret 256color-style SGRsJune McEnroe 2019-07-11Use inline style rather than <b>, <i>, <u>June McEnroe 2019-07-11Factor out clearJune McEnroe 2019-07-11Add bright option to shottyJune McEnroe 2019-07-11Output <b>, <i>, <u> in shottyJune McEnroe 2019-07-10Ignore SM and RMJune McEnroe 2019-07-09Add shotty man page and build itJune McEnroe 2019-07-09Add up -cJune McEnroe 2019-07-09Add options for default colors to shottyJune McEnroe 2019-07-08Use char literals consistentlyJune McEnroe