diff options
author | Eli Zaretskii <eliz@gnu.org> | 2013-11-02 15:03:32 +0200 |
---|---|---|
committer | Eli Zaretskii <eliz@gnu.org> | 2013-11-02 15:03:32 +0200 |
commit | 1fd201bb1d720d0c5ab727a3972363778eef834f (patch) | |
tree | 508abf22dbb91d24309869bc42a93e814f9fbcd6 /src/unexw32.c | |
parent | 5c4a19a90f803ed46629c2bdc1ac3d3563caa738 (diff) |
Adapted dostounix_filename. w32-short/long-filename work with wide APIs.
Diffstat (limited to 'src/unexw32.c')
-rw-r--r-- | src/unexw32.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/unexw32.c b/src/unexw32.c index a01ac79959..5320ec1e37 100644 --- a/src/unexw32.c +++ b/src/unexw32.c @@ -728,9 +728,15 @@ unexec (const char *new_name, const char *old_name) char *q; /* Ignore old_name, and get our actual location from the OS. */ - if (!GetModuleFileName (NULL, in_filename, MAX_PATH)) + if (!GetModuleFileNameA (NULL, in_filename, MAX_PATH)) abort (); - dostounix_filename (in_filename, 0); + + /* Can't use dostounix_filename here, since that needs its file name + argument encoded in UTF-8. */ + for (p = in_filename; *p; p = CharNextA (p)) + if (*p == '\\') + *p = '/'; + strcpy (out_filename, in_filename); /* Change the base of the output filename to match the requested name. */ |