On Sat, 29 Nov 2003, Igor Pechtchanski wrote:

> On Sat, 22 Nov 2003, Harold L Hunt II wrote:
>
> > Igor,
> >
> > Igor Pechtchanski wrote:
> > > On Fri, 21 Nov 2003, Harold L Hunt II wrote:
> > >
> > >>Igor,
> > >>
> > >>Igor Pechtchanski wrote:
> > >>
> > >>
> > >>>On Fri, 21 Nov 2003, Chan Seng Loong wrote:
> > >>>
> > >>>>hi again...
> > >>>>
> > >>>>Thanks to Mr. Igor Pechtchanski, the "[: Seng: unknown
> > >>>>operand" problem is eleminated with the power of ""
> > >>>>qutoes :-D
> > >>>
> > >>>Good.  Harold, how do you want to go about incorporating the patch?
> > >>
> > >>As you suspected, I think this is actually a generated file.  Granted,
> > >>the input is similar to the output, but it is a different file that
> > >>needs to be patched.  Again, I cannot check this right now.
> > >>
> > >>As far as what to do with the patch, it is hard to say.  Are you just
> > >>asking about how it will get into my next release?  That should be easy.
> > >>  As far as finding it an upstream home, we still have to wait for the
> > >>tree on freedesktop.org to finish being setup.
> > >>
> > >>Harold
> > >
> > > Ok, I'll try to checkout the CVS tree at some point soon and produce this
> > > patch off the correct file.
> >
> > Base the patch off of the SourceForge tree that we have for now:
> >
> > http://sourceforge.net/projects/xoncygwin/
> >
> > That's what I essentially do my builds from, so it should work.
> > Hopefully the file in question is actually in that tree... if not, then
> > just wait until our freedesktop.org tree is ready.
> >
> > Harold
>
> Harold,
>
> The file (startx.cpp) is in xc/programs/xinit, and the xoncygwin tree only
> has xc/programs/Xserver.  Are you going to use the tree on freedesktop.org
> (which is already set up at "xorg") for further builds of the non-server
> parts?  If so, should I use the MAIN branch there, or the XORG-CURRENT
> branch?
>         Igor

Harold,

Here's a patch against the HEAD of the MAIN branch in the xorg tree at
freedesktop.org.  ChangeLog is below.  Let me know if there's a problem.
        Igor
==============================================================================
ChangeLog:
2003-12-02  Igor Pechtchanski  <[EMAIL PROTECTED]>
        * xc/programs/xinit/startx.cpp: Make space-friendly.

-- 
                                http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_                [EMAIL PROTECTED]
ZZZzz /,`.-'`'    -.  ;-;;,_            [EMAIL PROTECTED]
     |,4-  ) )-,_. ,\ (  `'-'           Igor Pechtchanski, Ph.D.
    '---''(_/--'  `-'\_) fL     a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"I have since come to realize that being between your mentor and his route
to the bathroom is a major career booster."  -- Patrick Naughton
--- xc/programs/xinit/startx.cpp-orig   2003-12-02 13:10:12.000000000 -0500
+++ xc/programs/xinit/startx.cpp        2003-12-02 13:45:06.566899200 -0500
@@ -48,8 +48,9 @@ fi
 scoclientrc=$HOME/.startxrc
 #endif
 
-userclientrc=$HOME/.xinitrc
-userserverrc=$HOME/.xserverrc
+userclientrc="$HOME/.xinitrc"
+userserverrc="$HOME/.xserverrc"
+/* Note: XINITDIR and BINDIR should be space-free */
 sysclientrc=XINITDIR/xinitrc
 sysserverrc=XINITDIR/xserverrc
 defaultclient=BINDIR/xterm
@@ -64,19 +65,19 @@ if [ -f $scoclientrc ]; then
     defaultclientargs=$scoclientrc
 else
 #endif
-if [ -f $userclientrc ]; then
-    defaultclientargs=$userclientrc
-elif [ -f $sysclientrc ]; then
-    defaultclientargs=$sysclientrc
+if [ -f "$userclientrc" ]; then
+    defaultclientargs="\"$userclientrc\""
+elif [ -f "$sysclientrc" ]; then
+    defaultclientargs="\"$sysclientrc\""
 fi
 #ifdef SCO
 fi
 #endif
 
-if [ -f $userserverrc ]; then
-    defaultserverargs=$userserverrc
-elif [ -f $sysserverrc ]; then
-    defaultserverargs=$sysserverrc
+if [ -f "$userserverrc" ]; then
+    defaultserverargs="\"$userserverrc\""
+elif [ -f "$sysserverrc" ]; then
+    defaultserverargs="\"$sysserverrc\""
 fi
 
 whoseargs="client"
@@ -86,15 +87,15 @@ while [ x"$1" != x ]; do
     /''*|\./''*)
        if [ "$whoseargs" = "client" ]; then
            if [ x"$clientargs" = x ]; then
-               client="$1"
+               client="\"$1\""
            else
-               clientargs="$clientargs $1"
+               clientargs="$clientargs \"$1\""
            fi
        else
            if [ x"$serverargs" = x ]; then
-               server="$1"
+               server="\"$1\""
            else
-               serverargs="$serverargs $1"
+               serverargs="$serverargs \"$1\""
            fi
        fi
        ;;
@@ -103,14 +104,14 @@ while [ x"$1" != x ]; do
        ;;
     *)
        if [ "$whoseargs" = "client" ]; then
-           clientargs="$clientargs $1"
+           clientargs="$clientargs \"$1\""
        else
            XCOMM display must be the FIRST server argument
            if [ x"$serverargs" = x ] && @@
                 expr "$1" : ':[0-9][0-9]*$' > /dev/null 2>&1; then
-               display="$1"
+               display="\"$1\""
            else
-               serverargs="$serverargs $1"
+               serverargs="$serverargs \"$1\""
            fi
        fi
        ;;
@@ -124,7 +125,7 @@ if [ x"$client" = x ]; then
     if [ x"$clientargs" = x ]; then
        client="$defaultclientargs"
     else
-       client=$defaultclient
+       client="$defaultclient"
     fi
 fi
 
@@ -134,12 +135,12 @@ if [ x"$server" = x ]; then
     if [ x"$serverargs" = x -a x"$display" = x ]; then
        server="$defaultserverargs"
     else
-       server=$defaultserver
+       server="$defaultserver"
     fi
 fi
 
 if [ x"$XAUTHORITY" = x ]; then
-    XAUTHORITY=$HOME/.Xauthority
+    XAUTHORITY="$HOME/.Xauthority"
     export XAUTHORITY
 fi
 
@@ -172,9 +173,13 @@ EOF
 done
 #endif
 
-xinit $client $clientargs -- $server $display $serverargs
+XCOMM correctly process quotes, etc
+eval "set -- $client $clientargs -- $server $display $serverargs"
+
+xinit "$@"
 
 if [ x"$removelist" != x ]; then
+    XCOMM Note: this is still not space-friendly!
     xauth remove $removelist
 fi
 

Reply via email to