diff options
author | Benjamin Franzke <benjaminfranzke@googlemail.com> | 2011-07-12 21:06:36 +0200 |
---|---|---|
committer | Benjamin Franzke <benjaminfranzke@googlemail.com> | 2011-07-12 21:09:36 +0200 |
commit | 03da3083dc111e005da4d57c499966983d3fa7c8 (patch) | |
tree | 1562dcf8a0f8cad1dfac9c6394aaeb509fc50d5d /src | |
parent | fe63dfa5c0283b2e746c1ad6d887c721a1f22ab9 (diff) | |
download | cmumble-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.
Diffstat (limited to 'src')
-rw-r--r-- | src/gen_messages.sed | 17 |
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\ |