From patchwork Tue Dec 10 18:47:36 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ryan Mansfield X-Patchwork-Id: 299528 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id ECCAC2C0314 for ; Wed, 11 Dec 2013 09:47:47 +1100 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:subject:content-type; q= dns; s=default; b=wlNbn5bmlOudl2Zvdi3kKXKvpQs+vvJmN1vY71j5ZBSDNZ BjqhHaDt9FlrsFep8iArE4xhwG7m+81J7p8COwt3FJ/LWdyRzD89U9qUclhB7m3o qsYnEO3x1dMIFkQRWYnU/iHyljqhAXEFnFGXrb9sDOPZE9bd/9kKJFBa8bNU8= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:subject:content-type; s= default; bh=dMyPCGWczF1AvvMZ2WUYex/g544=; b=rkfaGNEmEimWnD2cU9hu d0cNuHDCkfCfWcdBy9lFogsl6DAq4LdjQUveax8lEJPnZ1cnFXyfPIwKd45/LquW 6WtHKIVbkCUlirVbpr07bQx/O4WK0jXo2YltGA71/PiS4CHL30MFY6fJHLY98iGa I1QsaEsI5WLgoAQMute7ljY= Received: (qmail 9364 invoked by alias); 10 Dec 2013 18:47:46 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 9353 invoked by uid 89); 10 Dec 2013 18:47:45 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL, BAYES_00 autolearn=ham version=3.3.2 X-HELO: MXA.ott.qnx.com Received: from Unknown (HELO MXA.ott.qnx.com) (72.1.200.108) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Tue, 10 Dec 2013 18:47:45 +0000 X-ASG-Debug-ID: 1386701375-0721882e29a25a0001-Gfy7bY Received: from exhts.ott.qnx.com (exch2.ott.qnx.com [10.222.2.136]) by MXA.ott.qnx.com with ESMTP id iXH2n8f1ltPxoyEK (version=TLSv1 cipher=AES128-SHA bits=128 verify=NO) for ; Tue, 10 Dec 2013 13:49:35 -0500 (EST) X-Barracuda-Envelope-From: RMansfield@qnx.com Received: from [10.222.100.35] (10.222.2.5) by EXCH2.ott.qnx.com (10.222.2.136) with Microsoft SMTP Server (TLS) id 14.3.123.3; Tue, 10 Dec 2013 13:47:36 -0500 Message-ID: <52A761C8.5060507@qnx.com> Date: Tue, 10 Dec 2013 13:47:36 -0500 From: Ryan Mansfield User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.1.1 MIME-Version: 1.0 To: Subject: [PATCH, preprocessor] Fix 56896 X-ASG-Orig-Subj: [PATCH, preprocessor] Fix 56896 X-Barracuda-Connect: exch2.ott.qnx.com[10.222.2.136] X-Barracuda-Start-Time: 1386701375 X-Barracuda-Encrypted: AES128-SHA X-Barracuda-URL: http://qnx-spam.ott.qnx.com:80/cgi-mod/mark.cgi X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using global scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=1000.0 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.142994 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-IsSubscribed: yes Fixes missing DIR_SEPARATOR if --with-gxx-include-dir configured as subdir of sysroot. 2013-12-10 Ryan Mansfield PR preprocessor/56896 * incpath.c (add_standard_paths): Strip trailing sysroot DIR_SEPARATOR only if appended path begins with DIR_SEPARATOR. Regards, Ryan Mansfield Index: incpath.c =================================================================== --- incpath.c (revision 205857) +++ incpath.c (working copy) @@ -179,7 +179,8 @@ char *sysroot_no_trailing_dir_separator = xstrdup (sysroot); size_t sysroot_len = strlen (sysroot); - if (sysroot_len > 0 && sysroot[sysroot_len - 1] == DIR_SEPARATOR) + if (sysroot_len > 0 && sysroot[sysroot_len - 1] == DIR_SEPARATOR + && p->fname[0] == DIR_SEPARATOR) sysroot_no_trailing_dir_separator[sysroot_len - 1] = '\0'; str = concat (sysroot_no_trailing_dir_separator, p->fname, NULL); free (sysroot_no_trailing_dir_separator);