Commit Diff


commit - 372960fedf033e1a18e08ae30d9d0a9096206266
commit + f5d230410ed12387146e129aab4e70db85ff670b
blob - 9f27a5b3838165f5f270d7da86b7e35a5068ed48
blob + 112a00ef6c99ee9cf2fbf8df43a49b9683220c99
--- Makefile.common.in
+++ Makefile.common.in
@@ -5,8 +5,7 @@ AM_CFLAGS += \
 	    -Wshadow -Wpointer-arith -Wno-sign-compare -Wundef \
 	    -Wbad-function-cast -Winline -Wcast-align \
 	    -Wdeclaration-after-statement -Wno-pointer-sign \
-	    -Wno-attributes -Wno-unused-result \
-	    -Wno-incompatible-pointer-types-discards-qualifiers
+	    -Wno-attributes -Wno-unused-result
 
 AM_CPPFLAGS += \
 	      @AM_CPPFLAGS@ \
blob - f4828b6c8a7e9c290972b5457c4a9c2f7d93597b
blob + bc331784c2f2ec466c7da7156184fb494b4cf2a0
--- regress/cmdline/commit.sh
+++ regress/cmdline/commit.sh
@@ -1377,7 +1377,9 @@ test_commit_prepared_logmsg() {
 
 	cat > $testroot/editor.sh <<EOF
 #!/bin/sh
-sed -i '' 's/foo/bar/' "\$1"
+SOPTS='-i ""'
+[ "\$OSTYPE" = "linux-gnu" ] && SOPTS="-i"
+sed "\$SOPTS" -e 's/foo/bar/' "\$1"
 EOF
 	chmod +x $testroot/editor.sh
 
blob - daf8b3ad0ba368a26d5b4278e6746fb270a59784
blob + 2b9c219181faf1e6ff070cc5d50165ed2ef06211
--- regress/cmdline/common.sh
+++ regress/cmdline/common.sh
@@ -31,7 +31,7 @@ date()
 	DATECMD="date"
 	[ "$OSTYPE" != "linux-gnu" ] && DATECMD="gdate"
 
-	"$DATECMD" "$@"
+	command "$DATECMD" "$@"
 }
 
 ln()
@@ -39,16 +39,23 @@ ln()
 	LNCMD="ln"
 	[ "$OSTYPE" != "linux-gnu" ] && LNCMD="gln"
 
-	"$LNCMD" "$@"
+	command "$LNCMD" "$@"
 }
 
-#sed()
-#{
-#	SEDCMD="sed"
-#	[ "$OSTYPE" != "linux-gnu" ] && LNCMD="gsed"
-#
-#	"$SEDCMD" "$@"
-#}
+sed()
+{
+	SEDCMD="sed"
+	[ "$OSTYPE" == "linux-gnu" ] && {
+		set -- "$@"
+		[ $# -ge 4 ] && {
+			shift 2
+			
+			command "$SEDCMD" -i "$@"
+			return
+		}
+	}
+	command "$SEDCMD" "$@"
+}
 
 
 git_init()
blob - 1faa01998f546ad7441d23eeccd924bc46fd980d
blob + c41e9a4f8236f9042cd3dc2623784b30c32f98f4
--- regress/cmdline/diff.sh
+++ regress/cmdline/diff.sh
@@ -427,14 +427,14 @@ test_diff_shows_conflict() {
 		return 1
 	fi
 
-	sed -i '' 's/2/22/' $testroot/repo/numbers
-	sed -i '' 's/8/33/' $testroot/repo/numbers
+	sed -i '' -e 's/2/22/' $testroot/repo/numbers
+	sed -i '' -e 's/8/33/' $testroot/repo/numbers
 	git_commit $testroot/repo -m "modified line 2"
 	local head_rev=`git_show_head $testroot/repo`
 
 	# modify lines 2 and 8 in conflicting ways
-	sed -i '' 's/2/77/' $testroot/wt/numbers
-	sed -i '' 's/8/88/' $testroot/wt/numbers
+	sed -i '' -e 's/2/77/' $testroot/wt/numbers
+	sed -i '' -e 's/8/88/' $testroot/wt/numbers
 
 	echo "C  numbers" > $testroot/stdout.expected
 	echo -n "Updated to refs/heads/master: $head_rev" \
blob - bab97d4aacb49217ed5a5c0a3bf43ae8df1729eb
blob + 2d72590bb4cccfd94b9d11567d69f4cec032c8e4
--- regress/cmdline/histedit.sh
+++ regress/cmdline/histedit.sh
@@ -1569,7 +1569,9 @@ test_histedit_fold_only() {
 
 	cat > $testroot/editor.sh <<EOF
 #!/bin/sh
-sed -i '' 's/.*/committing folded changes/' "\$1"
+SOPTS='-i ""'
+[ "\$OSTYPE" = "linux-gnu" ] && SOPTS="-i"
+sed "\$SOPTS" -e 's/.*/committing folded changes/' "\$1"
 EOF
 	chmod +x $testroot/editor.sh
 
@@ -1685,7 +1687,9 @@ test_histedit_fold_only_empty_logmsg() {
 
 	cat > $testroot/editor.sh <<EOF
 #!/bin/sh
-sed -i '' 'd' "\$1"
+SOPTS='-i ""'
+[ "\$OSTYPE" = "linux-gnu" ] && SOPTS="-i"
+sed "\$SOPTS" -e 'd' "\$1"
 EOF
 	chmod +x $testroot/editor.sh
 
blob - fa6a5ec7f7ae7fc88dcd3d405a9edc036a9eb6b3
blob + 4207312d06515498dcff259a63ba5523d4041696
--- regress/cmdline/stage.sh
+++ regress/cmdline/stage.sh
@@ -1444,9 +1444,9 @@ test_stage_patch() {
 		return 1
 	fi
 
-	sed -i -e 's/^2$/a/' $testroot/wt/numbers
-	sed -i -e 's/^7$/b/' $testroot/wt/numbers
-	sed -i -e 's/^16$/c/' $testroot/wt/numbers
+	sed -i '' -e 's/^2$/a/' $testroot/wt/numbers
+	sed -i '' -e 's/^7$/b/' $testroot/wt/numbers
+	sed -i '' -e 's/^16$/c/' $testroot/wt/numbers
 
 	# don't stage any hunks
 	printf "n\nn\nn\n" > $testroot/patchscript
@@ -1729,9 +1729,9 @@ test_stage_patch_twice() {
 		return 1
 	fi
 
-	sed -i -e 's/^2$/a/' $testroot/wt/numbers
-	sed -i -e 's/^7$/b/' $testroot/wt/numbers
-	sed -i -e 's/^16$/c/' $testroot/wt/numbers
+	sed -i '' -e 's/^2$/a/' $testroot/wt/numbers
+	sed -i '' -e 's/^7$/b/' $testroot/wt/numbers
+	sed -i '' -e 's/^16$/c/' $testroot/wt/numbers
 
 	# stage middle hunk
 	printf "n\ny\nn\n" > $testroot/patchscript
@@ -2167,9 +2167,9 @@ test_stage_patch_quit() {
 		return 1
 	fi
 
-	sed -i -e 's/^2$/a/' $testroot/wt/numbers
-	sed -i -e 's/^7$/b/' $testroot/wt/numbers
-	sed -i -e 's/^16$/c/' $testroot/wt/numbers
+	sed -i '' -e 's/^2$/a/' $testroot/wt/numbers
+	sed -i '' -e 's/^7$/b/' $testroot/wt/numbers
+	sed -i '' -e 's/^16$/c/' $testroot/wt/numbers
 	(cd $testroot/wt && got rm zzz > /dev/null)
 
 	# stage first hunk and quit; and don't pass a path argument to
@@ -2275,9 +2275,9 @@ test_stage_patch_incomplete_script() {
 		return 1
 	fi
 
-	sed -i -e 's/^2$/a/' $testroot/wt/numbers
-	sed -i -e 's/^7$/b/' $testroot/wt/numbers
-	sed -i -e 's/^16$/c/' $testroot/wt/numbers
+	sed -i '' -e 's/^2$/a/' $testroot/wt/numbers
+	sed -i '' -e 's/^7$/b/' $testroot/wt/numbers
+	sed -i '' -e 's/^16$/c/' $testroot/wt/numbers
 
 	# stage first hunk and then stop responding; got should error out
 	printf "y\n" > $testroot/patchscript
blob - 5cba17832df6f6116c7bcae1f7fb3c259c11c230
blob + 617773180b2eca26860783dcbc63d506914059e2
--- regress/cmdline/status.sh
+++ regress/cmdline/status.sh
@@ -177,11 +177,11 @@ test_status_shows_local_mods_after_update() {
 		return 1
 	fi
 
-	sed -i '' 's/2/22/' $testroot/repo/numbers
+	sed -i '' -e 's/2/22/' $testroot/repo/numbers
 	git_commit $testroot/repo -m "modified line 2"
 
 	# modify line 7; both changes should merge cleanly
-	sed -i '' 's/7/77/' $testroot/wt/numbers
+	sed -i '' -e 's/7/77/' $testroot/wt/numbers
 
 	echo "G  numbers" > $testroot/stdout.expected
 	echo -n "Updated to refs/heads/master: " >> $testroot/stdout.expected
@@ -335,12 +335,12 @@ test_status_shows_no_mods_after_complete_merge() {
 		return 1
 	fi
 
-	sed -i '' 's/2/22/' $testroot/repo/numbers
+	sed -i '' -e 's/2/22/' $testroot/repo/numbers
 	git_commit $testroot/repo -m "modified line 2"
 
 	sleep 1
 	# modify line 2 again; no local changes are left after merge
-	sed -i '' 's/2/22/' $testroot/wt/numbers
+	sed -i '' -e 's/2/22/' $testroot/wt/numbers
 
 	echo "G  numbers" > $testroot/stdout.expected
 	echo -n "Updated to refs/heads/master: " >> $testroot/stdout.expected
@@ -390,11 +390,11 @@ test_status_shows_conflict() {
 		return 1
 	fi
 
-	sed -i '' 's/2/22/' $testroot/repo/numbers
+	sed -i '' -e 's/2/22/' $testroot/repo/numbers
 	git_commit $testroot/repo -m "modified line 2"
 
 	# modify line 2 in a conflicting way
-	sed -i '' 's/2/77/' $testroot/wt/numbers
+	sed -i '' -e 's/2/77/' $testroot/wt/numbers
 
 	echo "C  numbers" > $testroot/stdout.expected
 	echo -n "Updated to refs/heads/master: " >> $testroot/stdout.expected
blob - 3b3d58a2e081bceb00cc302ffc67e0ab03817dd7
blob + 0cc8e6f70c11e911af90f3bcf58b3178c39ecfe2
--- regress/cmdline/unstage.sh
+++ regress/cmdline/unstage.sh
@@ -198,9 +198,9 @@ test_unstage_patch() {
 		return 1
 	fi
 
-	sed -i -e 's/^2$/a/' $testroot/wt/numbers
-	sed -i -e 's/^7$/b/' $testroot/wt/numbers
-	sed -i -e 's/^16$/c/' $testroot/wt/numbers
+	sed -i '' -e 's/^2$/a/' $testroot/wt/numbers
+	sed -i '' -e 's/^7$/b/' $testroot/wt/numbers
+	sed -i '' -e 's/^16$/c/' $testroot/wt/numbers
 
 	(cd $testroot/wt && got stage > /dev/null)
 	ret="$?"
@@ -818,9 +818,9 @@ test_unstage_patch_quit() {
 		return 1
 	fi
 
-	sed -i -e 's/^2$/a/' $testroot/wt/numbers
-	sed -i -e 's/^7$/b/' $testroot/wt/numbers
-	sed -i -e 's/^16$/c/' $testroot/wt/numbers
+	sed -i '' -e 's/^2$/a/' $testroot/wt/numbers
+	sed -i '' -e 's/^7$/b/' $testroot/wt/numbers
+	sed -i '' -e 's/^16$/c/' $testroot/wt/numbers
 	(cd $testroot/wt && got rm zzz > /dev/null)
 	(cd $testroot/wt && got stage > /dev/null)
 
blob - d93ef8c508fbe9bf2bafd25578af7d0c0c1b512b
blob + 2a7545564f078c5d130856c1ee10bc042b9e44f1
--- regress/cmdline/update.sh
+++ regress/cmdline/update.sh
@@ -660,12 +660,12 @@ test_update_merges_file_edits() {
 
 	echo "modified alpha" > $testroot/repo/alpha
 	echo "modified beta" > $testroot/repo/beta
-	sed -i '' 's/2/22/' $testroot/repo/numbers
+	sed -i '' -e 's/2/22/' $testroot/repo/numbers
 	git_commit $testroot/repo -m "modified 3 files"
 
 	echo "modified alpha, too" > $testroot/wt/alpha
 	touch $testroot/wt/beta
-	sed -i '' 's/7/77/' $testroot/wt/numbers
+	sed -i '' -e 's/7/77/' $testroot/wt/numbers
 
 	echo "C  alpha" > $testroot/stdout.expected
 	echo "U  beta" >> $testroot/stdout.expected