Import readline 7.0 (patch 5)
[deliverable/binutils-gdb.git] / readline / tilde.c
index d4c1da9e68d0a599e176ab8eabf8bac40ac4ffc9..95bc4215c525466f18acfecc1549693600fe4748 100644 (file)
@@ -236,7 +236,11 @@ tilde_expand (string)
       string += end;
 
       expansion = tilde_expand_word (tilde_word);
-      xfree (tilde_word);
+
+      if (expansion == 0)
+       expansion = tilde_word;
+      else
+       xfree (tilde_word);     
 
       len = strlen (expansion);
 #ifdef __CYGWIN__
@@ -360,8 +364,8 @@ tilde_expand_word (filename)
     {
       /* Prefix $HOME to the rest of the string. */
       expansion = sh_get_env_value ("HOME");
-#ifdef _WIN32
-      if (!expansion)
+#if defined (_WIN32)
+      if (expansion == 0)
        expansion = sh_get_env_value ("APPDATA");
 #endif
 
This page took 0.025562 seconds and 4 git commands to generate.