* path.cc (symlink_info::check): Correctly set 'ext_tacked_on'. Use this to
determine if user specified 'foo.lnk' explicitly. Reorganize slightly to get rid of one goto.
This commit is contained in:
parent
fdc5ebe9bf
commit
b9ce814089
|
@ -1,3 +1,9 @@
|
||||||
|
Fri May 25 11:07:07 2001 Christopher Faylor <cgf@cygnus.com>
|
||||||
|
|
||||||
|
* path.cc (symlink_info::check): Correctly set 'ext_tacked_on'. Use
|
||||||
|
this to determine if user specified 'foo.lnk' explicitly. Reorganize
|
||||||
|
slightly to get rid of one goto.
|
||||||
|
|
||||||
Fri May 25 10:15:00 2001 Corinna Vinschen <corinna@vinschen.de>
|
Fri May 25 10:15:00 2001 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
* path.cc (symlink_info::check): Add a check to return correctly
|
* path.cc (symlink_info::check): Add a check to return correctly
|
||||||
|
|
|
@ -2631,8 +2631,6 @@ symlink_info::check (char *path, const suffix_info *suffixes, unsigned opt)
|
||||||
|
|
||||||
pflags &= ~PATH_SYMLINK;
|
pflags &= ~PATH_SYMLINK;
|
||||||
|
|
||||||
ext_tacked_on = !*ext_here;
|
|
||||||
|
|
||||||
case_clash = FALSE;
|
case_clash = FALSE;
|
||||||
|
|
||||||
while (suffix.next ())
|
while (suffix.next ())
|
||||||
|
@ -2649,11 +2647,16 @@ symlink_info::check (char *path, const suffix_info *suffixes, unsigned opt)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
ext_tacked_on = !!*ext_here;
|
||||||
|
|
||||||
if (pcheck_case != PCHECK_RELAXED && !case_check (path)
|
if (pcheck_case != PCHECK_RELAXED && !case_check (path)
|
||||||
|| (opt & PC_SYM_IGNORE))
|
|| (opt & PC_SYM_IGNORE))
|
||||||
goto file_not_symlink;
|
goto file_not_symlink;
|
||||||
|
|
||||||
int sym_check = 0;
|
int sym_check;
|
||||||
|
|
||||||
|
sym_check = 0;
|
||||||
|
|
||||||
if (fileattr & FILE_ATTRIBUTE_DIRECTORY)
|
if (fileattr & FILE_ATTRIBUTE_DIRECTORY)
|
||||||
goto file_not_symlink;
|
goto file_not_symlink;
|
||||||
|
@ -2684,13 +2687,10 @@ symlink_info::check (char *path, const suffix_info *suffixes, unsigned opt)
|
||||||
case 1:
|
case 1:
|
||||||
res = check_shortcut (suffix.path, fileattr, h, contents, &error, &pflags);
|
res = check_shortcut (suffix.path, fileattr, h, contents, &error, &pflags);
|
||||||
if (res)
|
if (res)
|
||||||
{
|
break;
|
||||||
ext_tacked_on = 1;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
/* If searching for `foo' and then finding a `foo.lnk' which is
|
/* If searching for `foo' and then finding a `foo.lnk' which is
|
||||||
no shortcut, return the same as if file not found. */
|
no shortcut, return the same as if file not found. */
|
||||||
if (!suffix.lnk_match () || pathmatch(path, suffix.path))
|
if (!suffix.lnk_match () || !ext_tacked_on)
|
||||||
goto file_not_symlink;
|
goto file_not_symlink;
|
||||||
|
|
||||||
fileattr = (DWORD) -1;
|
fileattr = (DWORD) -1;
|
||||||
|
@ -2702,15 +2702,14 @@ symlink_info::check (char *path, const suffix_info *suffixes, unsigned opt)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
file_not_symlink:
|
||||||
|
is_symlink = FALSE;
|
||||||
|
syscall_printf ("not a symlink");
|
||||||
|
res = 0;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
goto out;
|
|
||||||
|
|
||||||
file_not_symlink:
|
|
||||||
is_symlink = FALSE;
|
|
||||||
syscall_printf ("not a symlink");
|
|
||||||
res = 0;
|
|
||||||
|
|
||||||
out:
|
|
||||||
syscall_printf ("%d = symlink.check (%s, %p) (%p)",
|
syscall_printf ("%d = symlink.check (%s, %p) (%p)",
|
||||||
res, suffix.path, contents, pflags);
|
res, suffix.path, contents, pflags);
|
||||||
return res;
|
return res;
|
||||||
|
|
Loading…
Reference in New Issue