diff -r 64461831f72d -r 85fcab58a95e Makefile.bundle.in
--- a/Makefile.bundle.in	Mon Oct 06 17:05:44 2008 +0000
+++ b/Makefile.bundle.in	Sun Oct 05 18:42:59 2008 +0000
@@ -33,8 +33,8 @@
 
 bundle: all
 	@echo '[BUNDLE] Constructing bundle'
-	$(Q)rm -rf   "$(BUNDLE_DIR)"
-	$(Q)mkdir -p "$(BUNDLE_DIR)"
+	$(Q)rm -rf   "${BUNDLE_DIR}"
+	$(Q)mkdir -p "${BUNDLE_DIR}"
 	$(Q)mkdir -p "$(BUNDLE_DIR)/docs"
 	$(Q)mkdir -p "$(BUNDLE_DIR)/scenario"
 	$(Q)mkdir -p "$(BUNDLE_DIR)/scenario/heightmap"
@@ -46,7 +46,7 @@
 	$(Q)mkdir -p "$(BUNDLE_DIR)/$(OSXAPP)/Contents/Resources"
 	$(Q)echo "APPL????" >                                          "$(BUNDLE_DIR)/$(OSXAPP)/Contents/PkgInfo"
 	$(Q)cp    "$(ROOT_DIR)/os/macosx/openttd.icns"                 "$(BUNDLE_DIR)/$(OSXAPP)/Contents/Resources/openttd.icns"
-	$(Q)$(ROOT_DIR)/os/macosx/plistgen.sh                          "$(BUNDLE_DIR)/$(OSXAPP)" "$(REV)"
+	$(Q)$(ROOT_DIR)/os/macosx/plistgen.sh                          "${BUNDLE_DIR}/$(OSXAPP)" "$(REV)"
 	$(Q)cp    "$(ROOT_DIR)/docs/OSX_install_instructions.txt"      "$(BUNDLE_DIR)/docs/"
 	$(Q)cp    "$(ROOT_DIR)/os/macosx/splash.png"                   "$(DATA_DIR)"
 endif
diff -r 64461831f72d -r 85fcab58a95e Makefile.in
--- a/Makefile.in	Mon Oct 06 17:05:44 2008 +0000
+++ b/Makefile.in	Sun Oct 05 18:42:59 2008 +0000
@@ -91,7 +91,7 @@
 	@echo " Going to reconfigure with last known settings..."
 	@echo "----------------"
 # Make sure we don't lock config.cache
-	@$(shell cat config.cache | sed 's#\\ #\\\\ #g') || exit 1
+	@$(shell cat config.cache | sed 's/\\ /\\\\ /g') || exit 1
 	@echo "----------------"
 	@echo "Reconfig done. Please re-execute make."
 	@echo "----------------"
diff -r 64461831f72d -r 85fcab58a95e Makefile.src.in
--- a/Makefile.src.in	Mon Oct 06 17:05:44 2008 +0000
+++ b/Makefile.src.in	Sun Oct 05 18:42:59 2008 +0000
@@ -96,7 +96,7 @@
 ifdef REVISION
 # Use specified revision (which should be of the form "r000").
 REV := $(REVISION)
-REV_NR := $(shell echo $(REVISION) | sed "s#[^0-9]##g")
+REV_NR := $(shell echo $(REVISION) | sed "s/[^0-9]//g")
 else
 # Use autodetected revisions
 REV      := $(shell echo "$(VERSIONS)" | cut -f 1 -d'	')
@@ -180,7 +180,7 @@
 
 # Convert x:/... paths to /x/... for mingw
 ifeq ($(OS), MINGW)
-	@cat Makefile.dep.tmp | sed 's#\([a-zA-Z]\):\/#\/\1\/#g' > Makefile.dep.tmp.mingw
+	@cat Makefile.dep.tmp | sed 's@\([a-zA-Z]\):\/@\/\1\/@g' > Makefile.dep.tmp.mingw
 	@cp Makefile.dep.tmp.mingw Makefile.dep.tmp
 	@rm -f Makefile.dep.tmp.mingw
 endif
@@ -209,7 +209,7 @@
 	{                                   \
 		print $$0                         \
 	}                                   \
-	' < Makefile.dep.tmp | sed 's#  *# #g;s# $$##' | $(SORT) > Makefile.dep
+	' < Makefile.dep.tmp | sed 's/  */ /g;s/ $$//' | $(SORT) > Makefile.dep
 
 	$(Q)rm -f Makefile.dep.tmp Makefile.dep.tmp.bak
 
diff -r 64461831f72d -r 85fcab58a95e config.lib
--- a/config.lib	Mon Oct 06 17:05:44 2008 +0000
+++ b/config.lib	Sun Oct 05 18:42:59 2008 +0000
@@ -390,7 +390,7 @@
 	configure="$CONFIGURE_EXECUTABLE --ignore-extra-parameters"
 	for p in $save_params_array; do
 		eval "v=\"\$$p\""
-		p=`echo "$p" | sed 's#_#-#g;s#\n##g;s# #\\ #g'`
+		p=`echo "$p" | sed 's/_/-/g;s/\n//g;s/ /\\ /g'`
 		# Only save those params that aren't empty
 		configure="$configure --$p=\"$v\""
 	done
@@ -846,7 +846,7 @@
 			doc_dir="$data_dir/docs"
 		fi
 	else
-		doc_dir="`echo $doc_dir | sed 's#\([^\]\)\\\\ #\1\\\\\\\\ #g;s#\([^\]\) #\1\\\\\\\\ #g'`"
+		doc_dir="`echo $doc_dir | sed 's/\([^\]\)\\\\ /\1\\\\\\\\ /g;s/\([^\]\) /\1\\\\\\\\ /g'`"
 	fi
 
 	if [ "$icon_theme_dir" = "1" ]; then
@@ -856,7 +856,7 @@
 			icon_theme_dir=""
 		fi
 	else
-		icon_theme_dir="`echo $icon_theme_dir | sed 's#\([^\]\)\\\\ #\1\\\\\\\\ #g;s#\([^\]\) #\1\\\\\\\\ #g'`"
+		icon_theme_dir="`echo $icon_theme_dir | sed 's/\([^\]\)\\\\ /\1\\\\\\\\ /g;s/\([^\]\) /\1\\\\\\\\ /g'`"
 	fi
 
 	if [ "$personal_dir" = "1" ]; then
@@ -868,7 +868,7 @@
 			personal_dir=".openttd"
 		fi
 	else
-		personal_dir="`echo $personal_dir | sed 's#\([^\]\)\\\\ #\1\\\\\\\\ #g;s#\([^\]\) #\1\\\\\\\\ #g'`"
+		personal_dir="`echo $personal_dir | sed 's/\([^\]\)\\\\ /\1\\\\\\\\ /g;s/\([^\]\) /\1\\\\\\\\ /g'`"
 	fi
 
 	if [ "$shared_dir" = "1" ]; then
@@ -879,7 +879,7 @@
 			shared_dir=""
 		fi
 	else
-		shared_dir="`echo $shared_dir | sed 's#\([^\]\)\\\\ #\1\\\\\\\\ #g;s#\([^\]\) #\1\\\\\\\\ #g'`"
+		shared_dir="`echo $shared_dir | sed 's/\([^\]\)\\\\ /\1\\\\\\\\ /g;s/\([^\]\) /\1\\\\\\\\ /g'`"
 	fi
 
 	if [ "$man_dir" = "1" ]; then
@@ -890,7 +890,7 @@
 			man_dir=""
 		fi
 	else
-		man_dir="`echo $man_dir | sed 's#\([^\]\)\\\\ #\1\\\\\\\\ #g;s#\([^\]\) #\1\\\\\\\\ #g'`"
+		man_dir="`echo $man_dir | sed 's/\([^\]\)\\\\ /\1\\\\\\\\ /g;s/\([^\]\) /\1\\\\\\\\ /g'`"
 	fi
 
 	if [ "$menu_dir" = "1" ]; then
@@ -901,7 +901,7 @@
 			menu_dir=""
 		fi
 	else
-		menu_dir="`echo $menu_dir | sed 's#\([^\]\)\\\\ #\1\\\\\\\\ #g;s#\([^\]\) #\1\\\\\\\\ #g'`"
+		menu_dir="`echo $menu_dir | sed 's/\([^\]\)\\\\ /\1\\\\\\\\ /g;s/\([^\]\) /\1\\\\\\\\ /g'`"
 	fi
 
 	# "set_universal_binary_flags" needs to be before "detect_iconv"
@@ -1192,7 +1192,7 @@
 			if [ "$os" = "OSX" ]; then
 				# fontconfig_config goes via pkg-config on all systems, which doesn't know --prefix
 				# Also, despite the reason we link to the .a file ourself (because we can't use -static), we do need to ask pkg-config about possible other deps
-				LIBS="$LIBS `$fontconfig_config --variable=prefix`/lib/libfontconfig.a `$fontconfig_config --libs --static | sed s#-lfontconfig##`"
+				LIBS="$LIBS `$fontconfig_config --variable=prefix`/lib/libfontconfig.a `$fontconfig_config --libs --static | sed s/-lfontconfig//`"
 			else
 				LIBS="$LIBS `$fontconfig_config --libs --static | tr '\n\r' '  '`"
 			fi
diff -r 64461831f72d -r 85fcab58a95e configure
--- a/configure	Mon Oct 06 17:05:44 2008 +0000
+++ b/configure	Sun Oct 05 18:42:59 2008 +0000
@@ -37,7 +37,7 @@
 		exit 1
 	fi
 	# Make sure we don't lock config.cache
-	cat config.cache | sed 's#\\ #\\\\ #g' > cache.tmp
+	cat config.cache | sed 's/\\ /\\\\ /g' > cache.tmp
 	sh cache.tmp
 	rm -f cache.tmp
 	exit $?
diff -r 64461831f72d -r 85fcab58a95e findversion.sh
--- a/findversion.sh	Mon Oct 06 17:05:44 2008 +0000
+++ b/findversion.sh	Sun Oct 05 18:42:59 2008 +0000
@@ -84,8 +84,8 @@
 	fi
 	HASH=`LC_ALL=C git rev-parse --verify HEAD 2>/dev/null | cut -c1-8`
 	REV="g$HASH"
-	BRANCH=`git branch|grep '[*]' | sed 's#\* ##;s#^master$##'`
-	REV_NR=`LC_ALL=C git log --pretty=format:%s "$SRC_DIR" | grep "^(svn r[0-9]*)" | head -n 1 | sed "s#.*(svn r\([0-9]*\)).*#\1#"`
+	BRANCH=`git branch|grep '[*]' | sed 's/\* //;s/^master$//'`
+	REV_NR=`LC_ALL=C git log --pretty=format:%s "$SRC_DIR" | grep "^(svn r[0-9]*)" | head -n 1 | sed "s/.*(svn r\([0-9]*\)).*/\1/"`
 elif [ -d "$ROOT_DIR/.hg" ]; then
 	# We are a hg checkout
 	if [ -n "`hg status \"$SRC_DIR\" | grep -v '^?'`" ]; then
@@ -93,8 +93,8 @@
 	fi
 	HASH=`LC_ALL=C hg parents 2>/dev/null | head -n 1 | cut -d: -f3 | cut -c1-8`
 	REV="h$HASH"
-	BRANCH=`hg branch | sed 's#^default$##'`
-	REV_NR=`LC_ALL=C hg log -r $HASH:0 -k "svn" -l 1 --template "{desc}\n" "$SRC_DIR" | grep "^(svn r[0-9]*)" | head -n 1 | sed "s#.*(svn r\([0-9]*\)).*#\1#"`
+	BRANCH=`hg branch | sed 's/^default$//'`
+	REV_NR=`LC_ALL=C hg log -r $HASH:0 -k "svn" -l 1 --template "{desc}\n" "$SRC_DIR" | grep "^(svn r[0-9]*)" | head -n 1 | sed "s/.*(svn r\([0-9]*\)).*/\1/"`
 else
 	# We don't know
 	MODIFIED="1"
