From patchwork Mon Jun 29 04:08:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Carlos O'Donell X-Patchwork-Id: 39824 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 23989388F05B; Mon, 29 Jun 2020 04:08:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 23989388F05B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1593403712; bh=fsW1i6IiwuKvqg+wzgxuWhrUhm6WbBmXvClUQZ0fRug=; h=Subject:To:References:Date:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=x0JDL/UT/MNCMECgE/I6l2FQfeVdRxAok0USZQYJZz+IBdqXrBwPIhyhv1E7KEkNp ms5JBfHOvdLT8/aiXhxMMeOEEfTncUqzD3TMTFkIYAjVnfKP88PCkS6DP2T9DODbrd 0iTSMVsVPuurUkGcbmyQBzE7/uLF8Twq8oOJgmlI= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from us-smtp-delivery-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by sourceware.org (Postfix) with ESMTP id B40C3383F84B for ; Mon, 29 Jun 2020 04:08:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org B40C3383F84B Received: from mail-qv1-f70.google.com (mail-qv1-f70.google.com [209.85.219.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-97-Jetw5feOMGCp3XZrwACbAQ-1; Mon, 29 Jun 2020 00:08:23 -0400 X-MC-Unique: Jetw5feOMGCp3XZrwACbAQ-1 Received: by mail-qv1-f70.google.com with SMTP id q5so10986129qvp.23 for ; Sun, 28 Jun 2020 21:08:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:references:organization :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=fsW1i6IiwuKvqg+wzgxuWhrUhm6WbBmXvClUQZ0fRug=; b=E3Bd3r2ANpVMSBhTGqmZo5VR7nFRHTNxfpFy/HbGtVlXzcwfPl+UVnQfqOBoB/WxWX 34bxpwdp+O5OZZOP6SacWDWG7cJx9nPbcj7pumGeMl3mYqgdv1Hmo72ZJupLrKjEOHFG FMoZnG60ntzm6hkgUh64xtUTL1QNrI9wXbO/5zFT2pHH9eLmrYU1QDxZJDgcNFxD/Ylu 9gfrygDZ50z7GkdwABNgvLtxx1JZP5mo74SwjUKl6ObjfUA7RUzXeRYs74IEk5pWzNn+ jVe14JFvvXeVotd9iLknZLODBorQDrJ2NXTtPsl1egWaO9uj1stJqvans/V1GZIXIpXI OUxQ== X-Gm-Message-State: AOAM533teheR5U2E3ISaNfwaV/m28rUlJd1SB1z5RhadGqQiSiQFWHsc USMX5/GEovlx2qEbtkQkliUSxFyPJXw5kgSvrgLD2bhUPJlmZAQ7Zi5klYuplYLh0rO7aoLKvE3 2Wosmv0BiK499EbN2G3Qu X-Received: by 2002:ac8:2928:: with SMTP id y37mr14123305qty.245.1593403703467; Sun, 28 Jun 2020 21:08:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz+9h8fkFXFCSVP2mcI3w+YGEjE7EG1WfOfBCxgSOAxznQyWi6dAmQ5dT95eJpq8ISpfWP1Nw== X-Received: by 2002:ac8:2928:: with SMTP id y37mr14123289qty.245.1593403703277; Sun, 28 Jun 2020 21:08:23 -0700 (PDT) Received: from [192.168.1.4] (198-84-170-103.cpe.teksavvy.com. [198.84.170.103]) by smtp.gmail.com with ESMTPSA id k14sm15809920qtm.38.2020.06.28.21.08.22 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 28 Jun 2020 21:08:22 -0700 (PDT) Subject: [PATCH 1/2] LC_COLLATE: Fix handling of last character in ellipsis, (Bug 22668) To: libc-alpha , Hanataka Shinya References: <75d21bd8-2698-2e25-969c-4e086c90abd9@redhat.com> Organization: Red Hat Message-ID: Date: Mon, 29 Jun 2020 00:08:21 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <75d21bd8-2698-2e25-969c-4e086c90abd9@redhat.com> Content-Language: en-US X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-12.4 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Carlos O'Donell via Libc-alpha From: Carlos O'Donell Reply-To: Carlos O'Donell Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" During ellipsis processing the collation cursor was not correctly moved to the end of the ellipsis after processing. This meant that the cursor was left, usually, at the second to last entry. Subsequent operations end up unlinking the ellipsis end entry or just leaving it in the list dangling from the end. This kind of dangling is immediately visible in C.UTF-8 with the following sorting from strcoll: With the cursor correctly adjusted the end entry is correctly given the right location and thus the right weight. No regressions on x86_64 and i686. Co-authored-by: Carlos O'Donell --- locale/programs/ld-collate.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/locale/programs/ld-collate.c b/locale/programs/ld-collate.c index feb1a11258..a8ba2f07f0 100644 --- a/locale/programs/ld-collate.c +++ b/locale/programs/ld-collate.c @@ -1483,6 +1483,9 @@ order for `%.*s' already defined at %s:%Zu"), } } } + /* Move the cursor to the last entry in the ellipsis. + Subsequent operations need to start from the last entry. */ + collate->cursor = endp; }