diff options
author | rofl0r <retnyg@gmx.net> | 2014-06-12 15:48:11 +0200 |
---|---|---|
committer | rofl0r <retnyg@gmx.net> | 2014-06-12 15:48:14 +0200 |
commit | 1f0b51b1942a2c8975645d93c69e426d5fa0efa2 (patch) | |
tree | b341802c7c07b2f51d10a2007beb4e20ffa1bf70 | |
parent | 3cdb942c6b3e45dfdcc21f521babf7ba318d0566 (diff) | |
download | gettext-tiny-1f0b51b1942a2c8975645d93c69e426d5fa0efa2.tar.gz |
msgmerge: countermeasure against configure checks
some configure scripts check for msgmerge by executing
msgmerge --update -q /dev/null /dev/null
i.e. they test the most exotic and useless usage case to make sure
they get *GNU* msgmerge and nothing else.
-rw-r--r-- | src/msgmerge.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/msgmerge.c b/src/msgmerge.c index 3122ba5..9b7b4fd 100644 --- a/src/msgmerge.c +++ b/src/msgmerge.c @@ -158,8 +158,6 @@ int main(int argc, char**argv) { } else if(streq(A+2, "update")) { set_update: update = 1; - fprintf(stdout, "error: update functionality unimplemented\n"); - exit(update); } else if(streq(A+2, "help")) syntax(); } else if(streq(A + 1, "o")) { @@ -192,20 +190,27 @@ int main(int argc, char**argv) { exit(1); } else if (streq(A+1, "h")) syntax(); } else if(expect_fn.out) { + if(update && streq(A, "/dev/null")) return 0; set_file(1, A, &files.out); expect_fn.out = 0; } else if(expect_fn.compend) { set_file(1, A, &files.compend); expect_fn.compend = 0; } else if(expect_fn.po) { + if(update && streq(A, "/dev/null")) return 0; set_file(0, A, &files.po); expect_fn.po = 0; expect_fn.pot = 1; } else if(expect_fn.pot) { + if(update && streq(A, "/dev/null")) return 0; set_file(0, A, &files.pot); expect_fn.pot = 0; } } + if(update) { + fprintf(stdout, "error: update functionality unimplemented\n"); + exit(update); + } if(!files.out || !files.po || !files.pot) syntax(); int ret = process(&files, update, backup); FILE** filearr = (FILE**) &files; |