From: Stefan Monnier Date: Fri, 7 Mar 2008 15:42:30 +0000 (+0000) Subject: (Fsubstitute_in_file_name): Fix up computation of maximum X-Git-Tag: emacs-pretest-22.1.92~2 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=3efaadb7b2c3e5c4e7e48622b1def6e2872cf866;p=emacs.git (Fsubstitute_in_file_name): Fix up computation of maximum size of resulting string. --- diff --git a/src/ChangeLog b/src/ChangeLog index 0ddc633e61f..b2310ae76c2 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2008-03-07 Stefan Monnier + + * fileio.c (Fsubstitute_in_file_name): Fix up computation of maximum + size of resulting string. + 2008-03-05 Jason Rumney * dispnew.c (adjust_glyph_matrix): Initialize window_height. diff --git a/src/fileio.c b/src/fileio.c index c5bff5b8153..769a719191e 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -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 == '}')