From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4348 invoked by alias); 23 May 2014 21:02:59 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 4337 invoked by uid 89); 23 May 2014 21:02:58 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 X-HELO: ni.com Received: from skprod2.natinst.com (HELO ni.com) (130.164.80.23) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Fri, 23 May 2014 21:02:58 +0000 Received: from us-aus-mgwout2.amer.corp.natinst.com (nb-chan1-1338.natinst.com [130.164.19.134]) by us-aus-skprod2.natinst.com (8.14.5/8.14.5) with ESMTP id s4NL2tmB010997 for ; Fri, 23 May 2014 16:02:56 -0500 Received: from linuxgetsreal.amer.corp.natinst.com ([130.164.14.198]) by us-aus-mgwout2.amer.corp.natinst.com (Lotus Domino Release 8.5.3FP5) with SMTP id 2014052316025498-279406 ; Fri, 23 May 2014 16:02:54 -0500 Received: by linuxgetsreal.amer.corp.natinst.com (sSMTP sendmail emulation); Fri, 23 May 2014 16:02:54 -0500 From: "Brad Mouring" To: gdb-patches@sourceware.org Cc: Brad Mouring Subject: [PATCH] gdb/source.c: Fix source path substitution Date: Fri, 23 May 2014 21:02:00 -0000 Message-Id: <1400878971-6311-1-git-send-email-brad.mouring@ni.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.11.96,1.0.14,0.0.0000 definitions=2014-05-23_07:2014-05-23,2014-05-23,1970-01-01 signatures=0 X-SW-Source: 2014-05/txt/msg00601.txt.bz2 Substitute source path functionality never worked on non-Windows platforms due to straight strcmp tests returning non-zeros. Signed-off-by: Brad Mouring --- gdb/source.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gdb/source.c b/gdb/source.c index c77a4f4..7b59d77 100644 --- a/gdb/source.c +++ b/gdb/source.c @@ -946,7 +946,7 @@ substitute_path_rule_matches (const struct substitute_path_rule *rule, strncpy (path_start, path, from_len); path_start[from_len] = '\0'; - if (FILENAME_CMP (path_start, rule->from) != 0) + if (filename_ncmp (path_start, rule->from, from_len) != 0) return 0; /* Make sure that the region in the path that matches the substitution @@ -1897,7 +1897,7 @@ show_substitute_path_command (char *args, int from_tty) while (rule != NULL) { - if (from == NULL || FILENAME_CMP (rule->from, from) == 0) + if (from == NULL || filename_ncmp (rule->from, from, strlen(rule->from)) == 0) printf_filtered (" `%s' -> `%s'.\n", rule->from, rule->to); rule = rule->next; } -- 1.8.3-rc3