This is the mail archive of the
cygwin-patches
mailing list for the Cygwin project.
patch: Protect tcsh init scripts against home dirs with spaces in them
- From: Jeremy Elson <jelson at gmail dot com>
- To: cygwin-patches <cygwin-patches at cygwin dot com>
- Date: Mon, 2 Nov 2009 08:32:28 -0800
- Subject: patch: Protect tcsh init scripts against home dirs with spaces in them
- References: <51e5f6120911020821h3c3f1273sffa9107e22099eaa@mail.gmail.com> <51e5f6120911020831p61107af8u4193cbd1d81cb38c@mail.gmail.com>
Hi,
I'm not sure if this is a cygwin bug or an upstream bug, but I've
found a bug in the latest
cygwin 1.7 beta that prevents tcsh from initializing correctly in home
directories with spaces
in them. ?A Windows username with a space (e.g., "John Doe") produces
a home directory
with a space, so this is a pretty common case.
The patch below uses double-quotes to protect a filename with a space
from becoming two
arguments in /etc/profile.d/complete.tcsh. ?Most of that script is
already similarly protected
but this one was overlooked. ?Starting tcsh without this patch on a
home directory that
contains a space just generates an error of "if: Expression syntax",
and the rest of the init
scripts fail.
Thanks,
Jeremy Elson
--- /etc/profile.d/complete.tcsh~ ? ? ? 2009-09-13 00:42:57.289250000 -0700
+++ /etc/profile.d/complete.tcsh ? ? ? ?2009-11-02 08:12:26.278608500 -0800
@@ -39,7 +39,7 @@ if ($?_complete) then
?? ? set noglob
?? ? if ( ! $?hosts ) set hosts
?? ? foreach f ("$HOME/.hosts" /usr/local/etc/csh.hosts
"$HOME/.rhosts" /etc/hosts.equiv)
- ? ? ? ?if ( -r $f ) then
+ ? ? ? ?if ( -r "$f" ) then
?? ? ? ? ? ?set hosts = ($hosts `grep -v "+" $f | grep -E -v "^#" | tr
-s " " " " | cut -f 1`)
?? ? ? ?endif
?? ? end