> In general I agree, but on the other hand, it seems to be easier to 
> maintain and also it looks like this is what other projects do as well 
> (e.g. git).

Well, this is the first time we've maintained it. :)

$ hg log -T '{node}\n' -r 'not closed() and file(txt2c.sh)' | wc -l
1


> > 1. We can support BSD's sed for txt2c.sh. The difference is just that
> > BSD sed only supports \n a an ascii escape.  (Will need literals in the
> > makefile.)  But -
> 
> What about other seds from other Unices?

BSD's sed is (as I understand) congruent to POSIX, so by adapting to BSD
sed we should fit with all POSIX sed.

I feel awful about using a GNU extension to sed when I wrote this.
My code quality has dropped dramatically since I resumed developing
primarily on Linux.

Does the attached patch work on BSD?  (Please save to patch, don't use
copy/paste.)

-- 
David Champion • [email protected]
diff -r 8f62001989cc txt2c.sh
--- a/txt2c.sh  Sat Feb 08 10:24:22 2014 -0800
+++ b/txt2c.sh  Thu Aug 06 15:59:22 2015 -0500
@@ -13,9 +13,9 @@
        sed \
            -e 's/\\/\\\\/g' \
            -e 's/"/\\"/g' \
-           -e 's/??/\?\?/g' \
-           -e 's/\t/\\t/'g \
-           -e 's/\r/\\r/g' \
+           -e 's/??/\\?\\?/g' \
+           -e 's/      /\\t/'g \
+           -e 's/
/\\r/g' \
            -e 's/^/    "/g' \
            -e 's/$/\\n"/g'
        echo ";"

Reply via email to