perf trace: Fix detection of script extension
authorBen Hutchings <ben@decadent.org.uk>
Sun, 10 Oct 2010 15:11:02 +0000 (16:11 +0100)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Sat, 23 Oct 2010 17:31:20 +0000 (15:31 -0200)
The extension starts with the last dot in the name, not the first.

Cc: Ingo Molnar <mingo@elte.hu>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <1286723462.2955.206.camel@localhost>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/builtin-trace.c

index 3ea62199ffe1a407f31f7bbca504ddbc5ccf52d0..deda1a93131e35640e24ab9d138ac84485cf207b 100644 (file)
@@ -282,7 +282,7 @@ static int parse_scriptname(const struct option *opt __used,
                script++;
        } else {
                script = str;
-               ext = strchr(script, '.');
+               ext = strrchr(script, '.');
                if (!ext) {
                        fprintf(stderr, "invalid script extension");
                        return -1;