From 6e07bbe94f952214c2880bad0d239a53aa48153d Mon Sep 17 00:00:00 2001 From: Christoph Mallon Date: Sun, 31 Aug 2008 22:04:47 +0000 Subject: [PATCH] Store a copy of the original option string pointer instead of conditionally recalculating it. [r21603] --- main.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/main.c b/main.c index c0b9448..5328e65 100644 --- a/main.c +++ b/main.c @@ -628,9 +628,11 @@ int main(int argc, char **argv) } else if (streq(option, "pipe")) { /* here for gcc compatibility */ } else if (option[0] == 'f') { - bool truth_value = true; - const char *opt; - GET_ARG_AFTER(opt, "-f"); + char const *orig_opt; + GET_ARG_AFTER(orig_opt, "-f"); + + char const *opt = orig_opt; + bool truth_value = true; if (opt[0] == 'n' && opt[1] == 'o' && opt[2] == '-') { truth_value = false; opt += 3; @@ -655,14 +657,12 @@ int main(int argc, char **argv) strstart(opt, "align-loops=") || strstart(opt, "align-jumps=") || strstart(opt, "align-functions=")) { - fprintf(stderr, "ignoring gcc option '-f%s'\n", truth_value ? opt : opt - 3); + fprintf(stderr, "ignoring gcc option '-f%s'\n", orig_opt); } else { - if (! truth_value) - opt -= 3; - int res = firm_option(opt); + int res = firm_option(orig_opt); if (res == 0) { - fprintf(stderr, "error: unknown Firm option '-f %s'\n", - opt); + fprintf(stderr, "error: unknown Firm option '-f%s'\n", + orig_opt); argument_errors = true; continue; } else if (res == -1) { -- 2.20.1