]> git.eshelyaron.com Git - emacs.git/commitdiff
(Fsubstitute_in_file_name): Fix up computation of maximum
authorStefan Monnier <monnier@iro.umontreal.ca>
Fri, 7 Mar 2008 15:42:30 +0000 (15:42 +0000)
committerStefan Monnier <monnier@iro.umontreal.ca>
Fri, 7 Mar 2008 15:42:30 +0000 (15:42 +0000)
size of resulting string.

src/ChangeLog
src/fileio.c

index 0ddc633e61f14085644cd4f8979fe1f32c556b6c..b2310ae76c252d9772640da1f9e498ec5b8ea491 100644 (file)
@@ -1,3 +1,8 @@
+2008-03-07  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * fileio.c (Fsubstitute_in_file_name): Fix up computation of maximum
+       size of resulting string.
+
 2008-03-05  Jason Rumney  <jasonr@gnu.org>
 
        * dispnew.c (adjust_glyph_matrix): Initialize window_height.
index c5bff5b8153b7ce49d5fd84152e1c3ab8865132f..769a719191eb528b371d42eba3b9857ac4b85446 100644 (file)
@@ -2226,8 +2226,8 @@ duplicates what `expand-file-name' does.  */)
        /* Get variable value */
        o = (unsigned char *) egetenv (target);
        if (o)
-         {
-           total += strlen (o);
+         { /* Eight-bit chars occupy upto 2 bytes in multibyte.  */
+           total += strlen (o) * (STRING_MULTIBYTE (filename) ? 2 : 1);
            substituted = 1;
          }
        else if (*p == '}')