From: Eli Zaretskii Date: Mon, 9 Dec 2013 20:21:58 +0000 (+0200) Subject: Fixed a bug in w32-long-file-name. X-Git-Tag: emacs-24.3.90~173^2^2~42^2~45^2~387^2~446^2~6 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=51caf50203be08ba6f15e0d72b777f036d6bee72;p=emacs.git Fixed a bug in w32-long-file-name. --- diff --git a/src/w32.c b/src/w32.c index db0b4fee485..bff0e53e8c8 100644 --- a/src/w32.c +++ b/src/w32.c @@ -2154,7 +2154,16 @@ get_long_basename (char * name, char * buf, int size) could return some unrelated file name in the same directory. */ if (_mbspbrk (fname_ansi, "?")) - cstatus = filename_from_ansi (fname_ansi, fname_utf8); + { + /* Find the basename of fname_ansi. */ + char *p = strrchr (fname_ansi, '\\'); + + if (!p) + p = fname_ansi; + else + p++; + cstatus = filename_from_ansi (p, fname_utf8); + } else { dir_handle = FindFirstFileA (fname_ansi, &find_data_ansi);