site  contact  subhomenews

SeaMonkey: spaces in path/filename

April 11, 2010 — BarryK
This is a very old problem. If you click on a HTML file, if the path or filename contain spaces then it won't open.

URI's need to have spaces encoded, as explained here:

http://www.blooberry.com/indexdot/html/topics/urlencoding.htm

So, I have modified /usr/local/bin/mozstart:
#!/bin/sh

#100411 fix for spaces in path/filename.

#Puppy does not want more than one instance of Moz running.

#aug06:
#note, must execute mozilla-bin here, as it is a script with
# a bug fix, and then executes seamonkey-bin.

COMTAIL="$@"

[ "$COMTAIL" = "" ] && exec mozilla #v3.94

URLPREFIX="`echo "$COMTAIL" | grep -E "http://|ftp://|https://|file://|-mail|-edit|-addressbook|-calendar|-remote"`"
if [ "$URLPREFIX" = "" ];then
COMTAIL="`echo -n "$COMTAIL" | sed -e 's/ /%20/g'`"
COMTAIL="file://${COMTAIL}"
else
URLPREFIX="`echo "$COMTAIL" | grep "^file://"`"
[ "$URLPREFIX" ] && COMTAIL="`echo -n "$COMTAIL" | sed -e 's/ /%20/g'`"
fi

ps | grep --extended-regexp 'mozilla\-bin|seamonkey\-bin' > /dev/null 2>&1
if [ $? -eq 0 ];then #=0 if found.
#exec /usr/lib/mozilla/mozilla-bin -remote "openURL($COMTAIL,new-tab)"
exec mozilla -remote "openURL($COMTAIL,new-tab)"
else
#exec /usr/lib/mozilla/mozilla-bin $COMTAIL
exec mozilla $COMTAIL
fi


And /usr/local/bin/mozedit:
#!/bin/sh


#Puppy does not want more than one instance of Moz running.

COMTAIL="$@"

ps | grep --extended-regexp 'mozilla\-bin|seamonkey\-bin' > /dev/null 2>&1
if [ $? -eq 0 ];then #=0 if found.
xmessage "Please open Composer from Window menu of currently running Mozilla"
else
#exec /usr/lib/mozilla/mozilla-bin -edit $@
COMTAIL="`echo -n "$COMTAIL" | sed -e 's/ /%20/g'`"
[ "`echo "$COMTAIL" | grep "^file://"`" = "" ] && COMTAIL="file://${COMTAIL}"
exec mozilla -edit $COMTAIL
fi


I modified the SM 2.0.4 PET package, and the SM template in Woof.

Tags: puppy