about summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2009-05-20 09:04:39 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2009-05-20 09:04:39 +0000
commitfeb29659f1be2d94569afed60919b351a685abc8 (patch)
treedafad940dc82a81ce3b87575abfaa12b1e2ea542 /Src
parentad3d514ac79b573ce43fa7089175de519f39f21d (diff)
downloadzsh-feb29659f1be2d94569afed60919b351a685abc8.tar.gz
zsh-feb29659f1be2d94569afed60919b351a685abc8.tar.xz
zsh-feb29659f1be2d94569afed60919b351a685abc8.zip
users/14143 plus tweak in padding code:
use default IFS if IFS is unset
Diffstat (limited to 'Src')
-rw-r--r--Src/subst.c7
-rw-r--r--Src/utils.c2
2 files changed, 5 insertions, 4 deletions
diff --git a/Src/subst.c b/Src/subst.c
index 8a695cee9..5d14c458a 100644
--- a/Src/subst.c
+++ b/Src/subst.c
@@ -714,9 +714,10 @@ dopadding(char *str, int prenum, int postnum, char *preone, char *postone,
     convchar_t cchar;
 
     MB_METACHARINIT();
-    if (*ifs)
-	def = dupstrpfx(ifs, MB_METACHARLEN(ifs));
-    else
+    if (!ifs || *ifs) {
+	char *tmpifs = ifs ? ifs : DEFAULT_IFS;
+	def = dupstrpfx(tmpifs, MB_METACHARLEN(tmpifs));
+    } else
 	def = "";
     if (preone && !*preone)
 	preone = def;
diff --git a/Src/utils.c b/Src/utils.c
index e7a4595b8..00d51a320 100644
--- a/Src/utils.c
+++ b/Src/utils.c
@@ -3162,7 +3162,7 @@ inittyptab(void)
     }
 #ifdef MULTIBYTE_SUPPORT
     set_widearray(wordchars, &wordchars_wide);
-    set_widearray(ifs, &ifs_wide);
+    set_widearray(ifs ? ifs : DEFAULT_IFS, &ifs_wide);
 #endif
     for (s = SPECCHARS; *s; s++)
 	typtab[STOUC(*s)] |= ISPECIAL;