* device/include/hc08/mc68hc908jkjl.h: committed fix for bug #1929739, thanks Alejand...
[fw/sdcc] / support / cpp2 / move-if-change
index 28fcfbb72f135718c20c4f1b0fa5d0b4b4e3b092..d267e7212a825d18b4c1e9f7adb1d8f521efa25e 100644 (file)
@@ -1,17 +1,32 @@
-#!/bin/sh\r
-# Like mv $1 $2, but if the files are the same, just delete $1.\r
-# Status is 0 if $2 is changed, 1 otherwise.\r
-if\r
-test -r $2\r
-then\r
-if\r
-cmp -s $1 $2\r
-then\r
-echo $2 is unchanged\r
-rm -f $1\r
-else\r
-mv -f $1 $2\r
-fi\r
-else\r
-mv -f $1 $2\r
-fi\r
+#!/bin/sh
+
+# Copyright (C) 1996 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+if
+test -r $2
+then
+if
+cmp $1 $2 > /dev/null
+then
+echo $2 is unchanged
+rm -f $1
+else
+mv -f $1 $2
+fi
+else
+mv -f $1 $2
+fi