* path.h (enum pathconv_arg): Change PC_FULL to PC_NOUILL.
* path.cc (path_conv::check): Test for PC_NOFULL rather than !PC_FULL.
(cygwin_conv_to_win32_path): Use PC_NOFULL to force non-absolute path.
2005-05-13 Christopher Faylor <cgf@timesys.com>
+ Remove PC_FULL from path_conv usage throughout.
+ * path.h (enum pathconv_arg): Change PC_FULL to PC_NOUILL.
+ * path.cc (path_conv::check): Test for PC_NOFULL rather than !PC_FULL.
+ (cygwin_conv_to_win32_path): Use PC_NOFULL to force non-absolute path.
+
+2005-05-13 Christopher Faylor <cgf@timesys.com>
+
* fhandler_netdrive.cc (fhandler_netdrive::exists): Assert that "//"
exists.
fhandler_base *fh;
DIR *res;
- fh = build_fh_name (name, NULL, PC_SYM_FOLLOW | PC_FULL);
+ fh = build_fh_name (name, NULL, PC_SYM_FOLLOW);
if (!fh)
res = NULL;
else if (fh->exists ())
{
int res = -1;
- path_conv real_dir (dir, PC_SYM_NOFOLLOW | PC_FULL | PC_WRITABLE);
+ path_conv real_dir (dir, PC_SYM_NOFOLLOW | PC_WRITABLE);
if (real_dir.error)
set_errno (real_dir.error);
fhandler_base *
build_fh_name (const char *name, HANDLE h, unsigned opt, suffix_info *si)
{
- path_conv pc (name, opt | PC_NULLEMPTY | PC_FULL | PC_POSIX, si);
+ path_conv pc (name, opt | PC_NULLEMPTY | PC_POSIX, si);
if (pc.error)
{
fhandler_base *fh = cnew (fhandler_nodevice) ();
case CW_GET_BINMODE:
{
const char *path = va_arg (arg, const char *);
- path_conv p (path, PC_SYM_FOLLOW | PC_FULL | PC_NULLEMPTY);
+ path_conv p (path, PC_SYM_FOLLOW | PC_NULLEMPTY);
if (p.error)
{
set_errno (p.error);
int
fhandler_disk_file::link (const char *newpath)
{
- path_conv newpc (newpath, PC_SYM_NOFOLLOW | PC_FULL | PC_POSIX);
+ path_conv newpc (newpath, PC_SYM_NOFOLLOW | PC_POSIX);
extern bool allow_winsymlinks;
if (newpc.error)
strcpy (new_lnk_buf, newpath);
strcat (new_lnk_buf, ".lnk");
newpath = new_lnk_buf;
- newpc.check (newpath, PC_SYM_NOFOLLOW | PC_FULL);
+ newpc.check (newpath, PC_SYM_NOFOLLOW);
}
query_open (query_write_attributes);
devn = FH_SOCKET;
#endif
- if (!(opt & PC_FULL))
+ if (opt & PC_NOFULL)
{
if (is_relpath)
mkrelpath (this->path);
strcpy (w32topath, reltopath);
if (use_winsym)
{
- win32_topath.check (topath, PC_FULL | PC_SYM_NOFOLLOW);
+ win32_topath.check (topath, PC_SYM_NOFOLLOW);
strcpy (w32topath, win32_topath);
}
if (cp)
}
else
{
- win32_topath.check (topath, PC_FULL | PC_SYM_NOFOLLOW);
+ win32_topath.check (topath, PC_SYM_NOFOLLOW);
strcpy (w32topath, win32_topath);
}
create_how = CREATE_NEW;
/* Convert path. First argument ensures that we don't check for NULL/empty/invalid
again. */
- path_conv path (PC_NONULLEMPTY, in_dir, PC_FULL | PC_SYM_FOLLOW | PC_POSIX);
+ path_conv path (PC_NONULLEMPTY, in_dir, PC_SYM_FOLLOW | PC_POSIX);
if (path.error)
{
set_errno (path.error);
extern "C" int
cygwin_conv_to_win32_path (const char *path, char *win32_path)
{
- path_conv p (path, PC_SYM_FOLLOW | PC_NO_ACCESS_CHECK);
+ path_conv p (path, PC_SYM_FOLLOW | PC_NO_ACCESS_CHECK | PC_NOFULL);
if (p.error)
{
win32_path[0] = '\0';
extern "C" int
cygwin_conv_to_full_win32_path (const char *path, char *win32_path)
{
- path_conv p (path, PC_SYM_FOLLOW | PC_FULL | PC_NO_ACCESS_CHECK);
+ path_conv p (path, PC_SYM_FOLLOW | PC_NO_ACCESS_CHECK);
if (p.error)
{
win32_path[0] = '\0';
extern suffix_info stat_suffixes[];
int err;
- path_conv real_path (path, PC_SYM_FOLLOW | PC_FULL, stat_suffixes);
+ path_conv real_path (path, PC_SYM_FOLLOW, stat_suffixes);
if (real_path.error)
err = real_path.error;
int i, num_elms, max_mount_path_len, size;
const char *p;
- path_conv pc(".", PC_FULL | PC_POSIX);
+ path_conv pc(".", PC_POSIX);
/* The theory is that an upper bound is
current_size + (num_elms * max_mount_path_len) */
PC_SYM_NOFOLLOW = 0x0002,
PC_SYM_IGNORE = 0x0004,
PC_SYM_CONTENTS = 0x0008,
- PC_FULL = 0x0010,
+ PC_NOFULL = 0x0010,
PC_NULLEMPTY = 0x0020,
PC_CHECK_EA = 0x0040,
PC_POSIX = 0x0080,
{
extern suffix_info stat_suffixes[];
int res = -1;
- fhandler_base *fh = build_fh_name (path, NULL, fmode | PC_FULL,
- stat_suffixes);
+ fhandler_base *fh = build_fh_name (path, NULL, fmode, stat_suffixes);
if (fh->error ())
{
debug_printf ("got %d error from build_fh_name", fh->error ());
char *ext;
debug_printf ("prog '%s'", prog);
- buf.check (prog, PC_SYM_FOLLOW | PC_FULL, std_suffixes);
+ buf.check (prog, PC_SYM_FOLLOW, std_suffixes);
if (!buf.exists () || buf.isdir ())
ext = NULL;
int res = -1;
DWORD devn;
- path_conv win32_name (ourname, PC_SYM_NOFOLLOW | PC_FULL);
+ path_conv win32_name (ourname, PC_SYM_NOFOLLOW);
if (win32_name.error)
{
extern "C" int
_remove_r (struct _reent *, const char *ourname)
{
- path_conv win32_name (ourname, PC_SYM_NOFOLLOW | PC_FULL);
+ path_conv win32_name (ourname, PC_SYM_NOFOLLOW);
if (win32_name.error)
{
extern "C" int
remove (const char *ourname)
{
- path_conv win32_name (ourname, PC_SYM_NOFOLLOW | PC_FULL);
+ path_conv win32_name (ourname, PC_SYM_NOFOLLOW);
if (win32_name.error)
{
int res = 0;
char *lnk_suffix = NULL;
- path_conv real_old (oldpath, PC_FULL | PC_SYM_NOFOLLOW);
+ path_conv real_old (oldpath, PC_SYM_NOFOLLOW);
if (real_old.error)
{
return -1;
}
- path_conv real_new (newpath, PC_FULL | PC_SYM_NOFOLLOW);
+ path_conv real_new (newpath, PC_SYM_NOFOLLOW);
/* Shortcut hack. */
char new_lnk_buf[CYG_MAX_PATH + 5];
strcpy (new_lnk_buf, newpath);
strcat (new_lnk_buf, ".lnk");
newpath = new_lnk_buf;
- real_new.check (newpath, PC_FULL | PC_SYM_NOFOLLOW);
+ real_new.check (newpath, PC_SYM_NOFOLLOW);
}
if (real_new.error || real_new.case_clash)
case _PC_POSIX_PERMISSIONS:
case _PC_POSIX_SECURITY:
{
- path_conv full_path (file, PC_SYM_FOLLOW | PC_FULL);
+ path_conv full_path (file, PC_SYM_FOLLOW);
if (full_path.error)
{
set_errno (full_path.error);
return -1;
}
- path_conv full_path (fname, PC_SYM_FOLLOW | PC_FULL);
+ path_conv full_path (fname, PC_SYM_FOLLOW);
if (!rootdir (full_path, root))
return -1;
if (strlen (path) >= CYG_MAX_PATH)
return -1;
- path_conv w32path (path, PC_SYM_NOFOLLOW | PC_FULL);
+ path_conv w32path (path, PC_SYM_NOFOLLOW);
if (w32path.exists ())
{
set_errno (EEXIST);
extern "C" int
chroot (const char *newroot)
{
- path_conv path (newroot, PC_SYM_FOLLOW | PC_FULL | PC_POSIX);
+ path_conv path (newroot, PC_SYM_FOLLOW | PC_POSIX);
int ret = -1;
if (path.error)