zsh-workers
 help / color / mirror / code / Atom feed
* Absolute pathnames on cygwin
@ 2000-10-19 14:50 Andrej Borsenkow
  2000-10-20  8:06 ` Bart Schaefer
  0 siblings, 1 reply; 2+ messages in thread
From: Andrej Borsenkow @ 2000-10-19 14:50 UTC (permalink / raw)
  To: ZSH workers mailing list

mw1g017@MW1G17C% print $PWD
/cygdrive/c/win32app/bin
mw1g017@MW1G17C% cd d:/temp
mw1g017@MW1G17C% print $PWD
/cygdrive/c/win32app/bin/d:/temp

The reason is obvious - Zsh does not understand that d:/temp is the absolute
path. The solution is not.

Simply adding test for `x:/' in cd_do_chdir did not work. Even if it would
prevent concatenation, it would leave pathname as d:/temp that may cause
problems in the future.

Current cygwin has a "superroot" notion to present Windows drives in Unix-like
tree form. By default it is `/cygdrive' prefix; /cygdrive/x refers to drive x.
There is a set of routines, notably cygwin_conv_to_posix_path, that are used
to convert all filenames to standard Unix-like form.

I believe, it makes no sense to try to recognize all possible forms of Windows
pathnames in Zsh - rather, we should simply call the above function and deal
with single Unix form. The only problem is, when should such function be
called.

There are possibly other places where this may cause confusion.

-andrej

Have a nice DOS!
B >>


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Absolute pathnames on cygwin
  2000-10-19 14:50 Absolute pathnames on cygwin Andrej Borsenkow
@ 2000-10-20  8:06 ` Bart Schaefer
  0 siblings, 0 replies; 2+ messages in thread
From: Bart Schaefer @ 2000-10-20  8:06 UTC (permalink / raw)
  To: ZSH workers mailing list

On Oct 19,  6:50pm, Andrej Borsenkow wrote:
}
} I believe, it makes no sense to try to recognize all possible
} forms of Windows pathnames in Zsh - rather, we should simply call
} [cygwin_conv_to_posix_path] and deal with single Unix form. The only
} problem is, when should such function be called.
}
} There are possibly other places where this may cause confusion.

There are probably a very large number of such places; think of all the
places where Clint just finished removing references to PATH_MAX.

Think of all the shell functions that manipulate paths with $x:h, $x:t,
${x#*/}, ${x%/*}, [[ $x == /* ]], etc.

The problem is only going to "go away" when the user stops referring to
Windows drives by `x:' and uses the /cygdrive form exclusively.  Otherwise
no matter how good a job zsh does of catching `x:' when it manipulates a
string it knows internally is a path name, there's a potential for strings
that it *doesn't* know are path names to become "mangled" (and then later
used as a path name, when it's too late for zsh to fix it).

This is not to say that we shouldn't try to fix e.g. `cd' to do the right
thing as often as possible, but that the general problem of nonuniform path
formats is very difficult except in a rigid UI where pathnames are never
entered except in pathname-typed input boxes.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2000-10-20  8:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-10-19 14:50 Absolute pathnames on cygwin Andrej Borsenkow
2000-10-20  8:06 ` Bart Schaefer

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).