From 3efaadb7b2c3e5c4e7e48622b1def6e2872cf866 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Fri, 7 Mar 2008 15:42:30 +0000 Subject: (Fsubstitute_in_file_name): Fix up computation of maximum size of resulting string. --- src/fileio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/fileio.c') diff --git a/src/fileio.c b/src/fileio.c index c5bff5b815..769a719191 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 == '}') -- cgit v1.2.3