<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -66,6 +66,7 @@ class Snap_FileAnalyzer {
     
         // include, and then scan for new classes
         include_once $file;
+        
         $classes = array_diff(get_declared_classes(), $classes);
     
         $output = array();</diff>
      <filename>core/util/analyzer/analyzer.php</filename>
    </modified>
    <modified>
      <diff>@@ -25,6 +25,8 @@ class Snap_Request {
      * @return string
      **/
     public static function mangleRequest($var) {
+        $var = str_replace(' ', '\ ', $var);
+        
         if (SNAP_CGI_MODE) {
             return str_replace('.', SNAP_MANGLE_STRING, $var);
         }
@@ -133,10 +135,20 @@ class Snap_Request {
                 break;
             }
         
+            $prev = '';
             foreach ($argv as $idx =&gt; $arg) {
                 if ($idx == 0) {
                     continue;
                 }
+                
+                // if there is a \ as last char, link to $prev and go again
+                if (strrpos($arg, '\\') + 1 === strlen($arg)) {
+                    $prev = $arg.' ';
+                    continue;
+                }
+                
+                $arg = $prev.$arg;
+                $prev = '';
             
                 if (strpos($arg, '--') === FALSE) {
                     $sequentials[] = $arg;</diff>
      <filename>core/util/request/request.php</filename>
    </modified>
    <modified>
      <diff>@@ -21,7 +21,7 @@ $options = Snap_Request::getLongOptions(array(
     'analyze'   =&gt; FALSE,
 ));
 
-$path       = $options[0];
+$path       = str_replace('\ ', ' ', $options[0]);
 $out_mode   = $options['out'];
 $php        = $options['php'];
 $xtn        = $options['match'];</diff>
      <filename>snaptest.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,14 +1,34 @@
 #!/bin/bash
 
+# Portable version of resolve_symlink to work across multiple
+# *nix flavors.
+function resolve_symlink {
+    SCRIPT=$1 NEWSCRIPT=''
+    until [ &quot;$SCRIPT&quot; = &quot;$NEWSCRIPT&quot; ]; do
+        if [ &quot;${SCRIPT:0:1}&quot; = '.' ]; then SCRIPT=$PWD/$SCRIPT; fi
+        cd $(dirname $SCRIPT)
+        if [ ! &quot;${SCRIPT:0:1}&quot; = '.' ]; then SCRIPT=$(basename $SCRIPT); fi
+        SCRIPT=${NEWSCRIPT:=$SCRIPT}
+        NEWSCRIPT=$(ls -l $SCRIPT | awk '{ print $NF }')
+    done
+    if [ ! &quot;${SCRIPT:0:1}&quot; = '/' ]; then SCRIPT=$PWD/$SCRIPT; fi
+    echo $(dirname $SCRIPT)
+}
+
+
 # change to shell script real location
-FPATH=`dirname &quot;$0&quot;`
+FPATH=$(resolve_symlink $0);
+
+# correct pwd to resolve any symlinks and spaces in the name
 OPATH=`pwd`
-cd $FPATH;
+# OPATH=`echo $OPATH | sed s/\ /\\\\\\\\\ /`
+
+cd $FPATH
 
 # load options
 . getoptx.sh
 
-cd $OPATH
+cd &quot;$OPATH&quot;
 
 # Auto Locate PHP
 PHPX=`which php`
@@ -64,6 +84,8 @@ if [ &quot;$RELPTH&quot; = &quot;RELPTHMATCH&quot; ] ; then
     PTH=&quot;$OPATH/$PTH&quot;
 fi
 
+PTH=`echo $PTH | sed &quot;s/ /\\\\\\ /g&quot;`;
+
 # choke and die if we couldn't auto-find PHP and the user didn't supply
 # a valid PHP executable path
 if [ -z $PHP ] ; then
@@ -77,6 +99,7 @@ CGI=`$PHP -v | grep cgi | wc -l | sed &quot;s/[^0-9]//g&quot;`
 
 # run php on the snaptest.php file with the commands
 if [ &quot;$CGI&quot; = &quot;0&quot; ] ; then
+    # PTH=`echo $PTH | sed &quot;s/ /__S_P_A_C_E__/g&quot;`
     CMD=&quot;$PHP -q $FPATH/snaptest.php --php=$PHP --nice=$NICE $CMD $PTH&quot;
 else
     # if we are running in CGI mode, we need to mangle our . characters
@@ -87,4 +110,5 @@ else
 
     CMD=&quot;$PHP -q $FPATH/snaptest.php --php=$PHPSAFE $CMDSAFE $PTHSAFE&quot;
 fi
+
 $CMD</diff>
      <filename>snaptest.sh</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>39b3d376d1580e3b03d8272dc59604655a49f478</id>
    </parent>
  </parents>
  <author>
    <name>Jakob Heuser</name>
    <email>jakob@felocity.org</email>
  </author>
  <url>http://github.com/Jakobo/snaptest/commit/fc70e679164a45e921b1d161f51b1c4d575693cf</url>
  <id>fc70e679164a45e921b1d161f51b1c4d575693cf</id>
  <committed-date>2009-06-07T19:17:47-07:00</committed-date>
  <authored-date>2009-06-07T19:17:47-07:00</authored-date>
  <message>fix to allow spaces in filenames (osx compatibility fix)</message>
  <tree>da6d89947714d7053d0651ab45cfec390c41712a</tree>
  <committer>
    <name>Jakob Heuser</name>
    <email>jakob@felocity.org</email>
  </committer>
</commit>
