summaryrefslogtreecommitdiff
path: root/src/w32.c
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2014-09-13 11:26:44 +0300
committerEli Zaretskii <eliz@gnu.org>2014-09-13 11:26:44 +0300
commita6cc335aef90cb4a2dc3fde77cbea9886240301e (patch)
tree2f01a0d438766d70cfbd50880950f6b2a4b0acf0 /src/w32.c
parente868e853a85fb4466ab045962a269db31760f354 (diff)
downloademacs-a6cc335aef90cb4a2dc3fde77cbea9886240301e.tar.gz
Fix expansion and encoding of sound file names on MS-Windows.
src/sound.c (Fplay_sound_internal): Encode the sound file name in the ANSI codepage. Expand it against data-directory, as per docs, not against the current directory. No need to make a local copy of the file name; pass the encoded file name directly to do_play_sound. (Bug#18463) src/w32.c (ansi_encode_filename): If w32_get_short_filename returns NULL, and the file name is not encodable in ANSI codepage, return the string with "?" replacement characters, which will fail the caller. This avoids returning a random value in that case.
Diffstat (limited to 'src/w32.c')
-rw-r--r--src/w32.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/w32.c b/src/w32.c
index 15e53600d95..fee1be22739 100644
--- a/src/w32.c
+++ b/src/w32.c
@@ -2387,6 +2387,8 @@ ansi_encode_filename (Lisp_Object filename)
dostounix_filename (shortname);
encoded_filename = build_string (shortname);
}
+ else
+ encoded_filename = build_unibyte_string (fname);
}
else
encoded_filename = build_unibyte_string (fname);