summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Franzke <benjaminfranzke@googlemail.com>2011-07-12 21:06:36 +0200
committerBenjamin Franzke <benjaminfranzke@googlemail.com>2011-07-12 21:09:36 +0200
commit03da3083dc111e005da4d57c499966983d3fa7c8 (patch)
tree1562dcf8a0f8cad1dfac9c6394aaeb509fc50d5d
parentfe63dfa5c0283b2e746c1ad6d887c721a1f22ab9 (diff)
downloadcmumble-03da3083dc111e005da4d57c499966983d3fa7c8.tar.gz
cmumble-03da3083dc111e005da4d57c499966983d3fa7c8.tar.bz2
cmumble-03da3083dc111e005da4d57c499966983d3fa7c8.zip
gen_messages.sed: Rewrite to be posix compatible
Posix sed doesnt have lower/uppercase (\L,\R) substitution qualifier.
-rw-r--r--src/gen_messages.sed17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/gen_messages.sed b/src/gen_messages.sed
index cf5a765..0013f5d 100644
--- a/src/gen_messages.sed
+++ b/src/gen_messages.sed
@@ -6,17 +6,16 @@ i\
#define MUMBLE_MSGS \\
}
-# Duplicate & Seperate with ","
-s/^.*$/\0, \0/
-
-# Next two rules operate on substring after first the ","
+# Backup original message name
+h
# Prefix uppercase characters that follow a lowercase one
-:a; s/\(, .*[a-z]\)\([A-Z]\)/\1_\2/g; ta
+s/\([a-z]\)\([A-Z]\)/\1_\2/g
# Lowercase uppercase characters
-s/,.*$/\L\0\E/
-
-# Put template macro around
-s/^.*$/\tMUMBLE_MSG(\0) \\/
+y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/
+# Append backup to lowercase underscored message
+G
+# Put template macro around (delete newline between both msgs, swap order)
+s/^\(.*\)\n\(.*\)$/\tMUMBLE_MSG(\2, \1) \\/
$ {
a\