From patchwork Mon Jul 4 22:51:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guilherme Janczak X-Patchwork-Id: 55710 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 A5FA33854160 for ; Mon, 4 Jul 2022 22:51:38 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A5FA33854160 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1656975098; bh=4Y1+j2tCazGttPPKj1XhyiX9uWZbubTY3KnR4gtwEus=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=uxnVuFtoaPKXKlRLYLrmjXynlWikpFHkK3PLvIk01PisAL+ppplpNkbJh7uGHf7tD UkiO83me3n3803yjckrk/ACIsv8pJ2baC1Lu7FGjMJnE3hsTPXb0ipEltHnWn2XME0 p4NW/mEJOLdgDi2ZHN88pufybYEp/bYvZ1unK8tc= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from forward103o.mail.yandex.net (forward103o.mail.yandex.net [37.140.190.177]) by sourceware.org (Postfix) with ESMTPS id 5D49F3858D1E for ; Mon, 4 Jul 2022 22:51:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 5D49F3858D1E Received: from myt6-93e3987b150a.qloud-c.yandex.net (myt6-93e3987b150a.qloud-c.yandex.net [IPv6:2a02:6b8:c12:400c:0:640:93e3:987b]) by forward103o.mail.yandex.net (Yandex) with ESMTP id A0B4B10A969C for ; Tue, 5 Jul 2022 01:51:13 +0300 (MSK) Received: from myt5-69594d4a41fa.qloud-c.yandex.net (myt5-69594d4a41fa.qloud-c.yandex.net [2a02:6b8:c12:3ca5:0:640:6959:4d4a]) by myt6-93e3987b150a.qloud-c.yandex.net (mxback/Yandex) with ESMTP id 7mQ4jqDOEb-pDf8tAEd; Tue, 05 Jul 2022 01:51:13 +0300 X-Yandex-Fwd: 2 Received: by myt5-69594d4a41fa.qloud-c.yandex.net (smtp/Yandex) with ESMTPSA id f64XaMbJCu-pBNuIZgw; Tue, 05 Jul 2022 01:51:12 +0300 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client certificate not present) Date: Mon, 4 Jul 2022 22:51:08 +0000 To: libc-alpha@sourceware.org Subject: [PATCH] argp: [!_LIBC]: remove __argp_basename() Message-ID: <20220704225108.6nr5573awh4fgjck@yandex.com> Mail-Followup-To: libc-alpha@sourceware.org MIME-Version: 1.0 Content-Disposition: inline X-Spam-Status: No, score=-12.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) 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: Guilherme Janczak via Libc-alpha From: Guilherme Janczak Reply-To: Guilherme Janczak Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" This function was added in commit f39941e4127085f2120e40ffefc287f8c4a9548a to make argp portable for usage in gnulib around 19 years ago, but gnulib's current master patches it out and uses its own solution: https://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=blob;f=lib/argp-namefrob.h;h=9c82ac79c215540f986c3e04398edba3ba1b7234;hb=HEAD#l157 https://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=blob;f=lib/argp-help.c;h=39d71685208ad296fc2c3cb6f8a176d406d41f07;hb=HEAD#l1829 --- argp/argp-help.c | 8 -------- argp/argp-namefrob.h | 2 -- 2 files changed, 10 deletions(-) diff --git a/argp/argp-help.c b/argp/argp-help.c index 90a2795cef..c22d09a6cb 100644 --- a/argp/argp-help.c +++ b/argp/argp-help.c @@ -1808,19 +1808,11 @@ weak_alias (__argp_help, argp_help) #endif #ifndef _LIBC -char *__argp_basename (char *name) -{ - char *short_name = strrchr (name, '/'); - return short_name ? short_name + 1 : name; -} - char * __argp_short_program_name (void) { # if HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME return program_invocation_short_name; -# elif HAVE_DECL_PROGRAM_INVOCATION_NAME - return __argp_basename (program_invocation_name); # else /* FIXME: What now? Miles suggests that it is better to use NULL, but currently the value is passed on directly to fputs_unlocked, diff --git a/argp/argp-namefrob.h b/argp/argp-namefrob.h index baed8f1999..c36d741c87 100644 --- a/argp/argp-namefrob.h +++ b/argp/argp-namefrob.h @@ -134,8 +134,6 @@ # define putchar_unlocked(x) putchar (x) # endif -extern char *__argp_basename (char *name); - #endif /* !_LIBC */ #ifndef __set_errno