From patchwork Wed Apr 24 14:22:50 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnaud Charlet X-Patchwork-Id: 239212 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 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "localhost", Issuer "www.qmailtoaster.com" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 864512C00F7 for ; Thu, 25 Apr 2013 00:23:05 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:mime-version:content-type; q=dns; s=default; b=Rltnn2jdEyY8DWu8klAa1rBRdl1QseSEVTdl9DSaHQpBlqXg9s iAyoGGA1scc9Oya6uQAn3hcAVRKUo9f8fYj2uo3nNyjfwhJ3/121IxwpAHzqfLzf 9FvKu3lIYkj6E+K4iLNUj5VP/dTRnbvolqzWwbSowFBQM74K7bHC6Hb74= 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:date :from:to:cc:subject:message-id:mime-version:content-type; s= default; bh=ZYOU5y2N7+zcJdvpC+EvbtPC/e0=; b=SiiL6lDKdXfoCzqaEL1A rjUk3OzJy0YEJUTRpoOWOzrOOWgVco+//QOCLkTdpzzV31wlAAAE4h+SPN0sEadb cP15iCZIWC74TBXqRBuYeCIUxUfxwOtMBU+rwoulnusvBYgoGZfnW1q3WP6xSRyc 94jRxwSYFHQ3nWtbj1fC9nE= Received: (qmail 31329 invoked by alias); 24 Apr 2013 14:22:52 -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 31296 invoked by uid 89); 24 Apr 2013 14:22:52 -0000 X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL, BAYES_00, RCVD_IN_HOSTKARMA_NO autolearn=ham version=3.3.1 Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Wed, 24 Apr 2013 14:22:52 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 855DB2ED0B; Wed, 24 Apr 2013 10:22:50 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id u6pCIsjFjbuZ; Wed, 24 Apr 2013 10:22:50 -0400 (EDT) Received: from kwai.gnat.com (kwai.gnat.com [205.232.38.4]) by rock.gnat.com (Postfix) with ESMTP id 6DAB12E651; Wed, 24 Apr 2013 10:22:50 -0400 (EDT) Received: by kwai.gnat.com (Postfix, from userid 4192) id 6C38F3FF09; Wed, 24 Apr 2013 10:22:50 -0400 (EDT) Date: Wed, 24 Apr 2013 10:22:50 -0400 From: Arnaud Charlet To: gcc-patches@gcc.gnu.org Cc: Vincent Celier Subject: [Ada] gnatfind and source file names on Windows Message-ID: <20130424142250.GA17225@adacore.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) X-Virus-Found: No On Windows, when gnatfind is called with a pattern and a source file name that includes capital letters, as in "gnatfind Put_Line:A-textio.ads -r", gnatfind does not give the same output that it would have if the file was not capitalized ("gnatfind Put_Line:a-textio.ads -r"). This is corrected by this patch. Tested on x86_64-pc-linux-gnu, committed on trunk 2013-04-24 Vincent Celier * xref_lib.adb (Add_Entity): Use the canonical file names so that source file names with capital letters are found on platforms where file names are case insensitive. Index: xref_lib.adb =================================================================== --- xref_lib.adb (revision 198221) +++ xref_lib.adb (working copy) @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1998-2012, Free Software Foundation, Inc. -- +-- Copyright (C) 1998-2013, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -272,18 +272,21 @@ end if; end if; - File_Ref := - Add_To_Xref_File - (Entity (File_Start .. Line_Start - 1), Visited => True); - Pattern.File_Ref := File_Ref; + declare + File_Name : String := Entity (File_Start .. Line_Start - 1); + begin + Osint.Canonical_Case_File_Name (File_Name); + File_Ref := Add_To_Xref_File (File_Name, Visited => True); + Pattern.File_Ref := File_Ref; - Add_Line (Pattern.File_Ref, Line_Num, Col_Num); + Add_Line (Pattern.File_Ref, Line_Num, Col_Num); - File_Ref := - Add_To_Xref_File - (ALI_File_Name (Entity (File_Start .. Line_Start - 1)), - Visited => False, - Emit_Warning => True); + File_Ref := + Add_To_Xref_File + (ALI_File_Name (File_Name), + Visited => False, + Emit_Warning => True); + end; end Add_Entity; -------------------