beautified?!
--HG--
branch : HEAD
diff --git a/lib/make_zip_err_str.sh b/lib/make_zip_err_str.sh
index 5427a65..6803421 100755
--- a/lib/make_zip_err_str.sh
+++ b/lib/make_zip_err_str.sh
@@ -2,22 +2,30 @@
if [ "$#" -ne 2 ]
then
- echo Usage: $0 in_file out_file >&2
- echo e.g. $0 zip.h zip_err_str.c >&2
+ echo "Usage: $0 in_file out_file" >&2
+ echo " e.g. $0 zip.h zip_err_str.c" >&2
exit 1
fi
if [ "$1" = "$2" ]
then
- echo $0: error: output file = input file >&2
+ echo "$0: error: output file = input file" >&2
exit 1
fi
-echo "/* This file was autogenerated by $0 from $1" > "$2.$$"
-echo " -- don't change here */" >> "$2.$$"
-echo '#include "zip.h"' >> "$2.$$"
-echo 'char *zip_err_str[] = {' >> "$2.$$"
-sed -n '/^#define ZERR_/ s/.*\/\* \([^*]*\) \*\// "\1",/p' "$1" >> "$2.$$"
-echo '};' >> "$2.$$"
+cat <<EOF >> "$2.$$" || exit 1
+/* This file was generated automatically by $0
+ from $1; make changes there. */
-mv "$2.$$" "$2"
+#include "zip.h"
+
+
+
+char *zip_err_str[] = {
+EOF
+
+sed -n '/^#define ZERR_/ s/.*\/\* \([^*]*\) \*\// "\1",/p' "$1" \
+ >> "$2.$$" || exit 1
+echo '};' >> "$2.$$" || exit 1
+
+mv "$2.$$" "$2" || exit 1