Eric Blake eblake@redhat.com
Tue Aug 21 15:35:00 GMT 2012

On 08/21/2012 04:16 AM, Achim Gratz wrote:
> I'm removing the Windows PATH in my startup scripts since there's nothing in
> there that I think should be accessible from Cygwin.

Unfortunately, at least your windows system dll directory has to be on
PATH, or cygwin1.dll will fail to load, so blindly removing ALL windows
paths from PATH is wrong.

> Also, there are two things in profile that may admit slight improvement (a place
> where LC_COLLATE is specified just for one command and better guarding against a
> missing or non-cdable /etc/skel).

A missing /etc/skel is a sign of mis-installation, but extra guards
won't hurt, I guess.  But you are wrong about the LC_COLLATE command
having no effect.  Remember, the shell is required to expand globbing
prior to executing a command, but that LC_COLLATE affects how globbing
is performed.  Therefore, you MUST separate the assignment from
LC_COLLATE from the globbing, if the globbing is to be affected (for
that matter, if LC_ALL is set, then it overrides LC_COLLATE, so it may
be better to patch this particular usage to set LC_ALL instead of

> @@ -103,7 +107,7 @@
>  # Shell dependent settings
>  profile_d ()
>  {
> -  for file in $(export LC_COLLATE=C; echo /etc/profile.d/*.$1); do
> +  for file in $(LC_COLLATE=C echo /etc/profile.d/*.$1); do

Given my above arguments, if this changes at all, it should change to:
for file in $(LC_ALL=C; echo /etc/profile.d/*.$1); do

but that is not safe for files containing whitespace.  If you want
safety, then we should avoid the $() and use globbing directly, although
it gets much longer with something like this:

for file in /etc/profile.d/*.$1; do
  if test $set_LC_ALL
    unset LC_ALL
  # original loop body
if test $set_LC_ALL
  unset LC_ALL
unset saved_LC_ALL set_LC_ALL

Eric Blake   eblake@redhat.com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 620 bytes
Desc: OpenPGP digital signature
URL: <http://cygwin.com/pipermail/cygwin/attachments/20120821/555b1a5d/attachment.sig>

More information about the Cygwin mailing list