* cygpath.c (get_long_name): Cover the case that GetLongPathName

doesn't return valid information for non-existant files.  Just return
	incoming filename in that case.
This commit is contained in:
Corinna Vinschen 2006-07-27 21:07:33 +00:00
parent fd5879c110
commit bc31293a0d
2 changed files with 16 additions and 4 deletions

View File

@ -1,3 +1,9 @@
2006-07-27 Corinna Vinschen <corinna@vinschen.de>
* cygpath.c (get_long_name): Cover the case that GetLongPathName
doesn't return valid information for non-existant files. Just return
incoming filename in that case.
2006-07-03 Kazuhiro Fujieda <fujieda@jaist.ac.jp>
* Makefile.in: Build setmetamode.exe.

View File

@ -239,11 +239,17 @@ get_long_name (const char *filename, DWORD& len)
GetLongPathName = get_long_path_name_w32impl;
len = GetLongPathName (filename, buf, MAX_PATH);
if (len == 0 && GetLastError () == ERROR_INVALID_PARAMETER)
if (len == 0)
{
fprintf (stderr, "%s: cannot create long name of %s\n", prog_name,
filename);
exit (2);
if (GetLastError () == ERROR_INVALID_PARAMETER)
{
fprintf (stderr, "%s: cannot create long name of %s\n", prog_name,
filename);
exit (2);
}
buf[0] = '\0';
strncat (buf, filename, MAX_PATH - 1);
len = strlen (buf);
}
sbuf = (char *) malloc (len + 1);
if (!sbuf)