* path.cc (add_ext_from_sym): New define evaluating `known'suffix'.

(path_conv::check): Use add_ext_from_sym throughout.
This commit is contained in:
Corinna Vinschen 2001-04-13 07:54:20 +00:00
parent cf620a6912
commit e61cead397
2 changed files with 15 additions and 19 deletions

View File

@ -1,4 +1,9 @@
Thu Apr 17 23:19:00 2001 Corinna Vinschen <corinna@vinschen.de>
Fri Apr 13 9:52:00 2001 Corinna Vinschen <corinna@vinschen.de>
* path.cc (add_ext_from_sym): New define evaluating `known'suffix'.
(path_conv::check): Use add_ext_from_sym throughout.
Thu Apr 12 23:19:00 2001 Corinna Vinschen <corinna@vinschen.de>
* dir.cc (mkdir): Check for case clash.
* environ.cc: Add extern declaration for `pcheck_case'.

View File

@ -179,6 +179,11 @@ pathmatch (const char *path1, const char *path2)
: strcasematch (path1, path2);
}
#define add_ext_from_sym(sym) \
(void)(sym.ext_here && *sym.ext_here && \
( known_suffix = this->path + sym.extn, \
(sym.ext_tacked_on && strcpy (known_suffix, sym.ext_here))))
/* Convert an arbitrary path SRC to a pure Win32 path, suitable for
passing to Win32 API routines.
@ -331,12 +336,7 @@ path_conv::check (const char *src, unsigned opt,
if (component == 0)
{
fileattr = sym.fileattr;
if (sym.ext_here && *sym.ext_here)
{
known_suffix = this->path + sym.extn;
if (sym.ext_tacked_on)
strcpy (known_suffix, sym.ext_here);
}
add_ext_from_sym (sym);
}
if (pcheck_case == PCHECK_RELAXED)
goto out; // file found
@ -361,12 +361,7 @@ path_conv::check (const char *src, unsigned opt,
strcpy (path, sym.contents);
goto out;
}
if (sym.ext_here && *sym.ext_here)
{
known_suffix = this->path + sym.extn;
if (sym.ext_tacked_on)
strcpy (known_suffix, sym.ext_here);
}
add_ext_from_sym (sym);
if (pcheck_case == PCHECK_RELAXED)
goto out;
/* Avoid further symlink evaluation. Only case checks are
@ -436,12 +431,8 @@ path_conv::check (const char *src, unsigned opt,
}
/*fillin:*/
if (sym.ext_here && *sym.ext_here && !(opt & PC_SYM_CONTENTS))
{
known_suffix = this->path + sym.extn;
if (sym.ext_tacked_on)
strcpy (known_suffix, sym.ext_here);
}
if (!(opt & PC_SYM_CONTENTS))
add_ext_from_sym (sym);
out:
/* Deal with Windows stupidity which considers filename\. to be valid