From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id BE1D03858403 for ; Fri, 9 Feb 2024 13:00:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org BE1D03858403 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org BE1D03858403 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1707483646; cv=none; b=vKrrHD4x1Amm97Ib/ckM8BX/zyCMma3N0bNPfeUKH99wA0lZxlDzqOfP8hskjtIshsRpGxdOYfoCfzKW5gxhW7SsfJbhNe2ji8wy9ZyGvK5I5YQ2RKSEhZX42AnSTmI/dq8NQ0lRk6UfgJQhNkS0gW4PB6mc6dXoqbYM/F8MB5g= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1707483646; c=relaxed/simple; bh=Pgpj7JC3rg1HAcFVop0DK9h9ri7kpKXg7auUjV1JGWI=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=nkQlQhBLbSf39lfsaBb5tPppR0kbkn8H3cs/YfqF4tX10dZ67BDGY3tEnEy4fh3jKj5uVdaM/0F32IxqSmn+gKR/aQu9ZDfjzo3MDybNoHICvaHZ0fZu+DVJjvKOTH79oAsuDfHWxqzOgXOtHEmmZdtCwiRW6ECxbZwHCwW0zgY= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1707483644; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=+gEvHMkAShsUr2GKZJgwPHmKmNoa8n2ucmsHFKOQSZ4=; b=gGbuXpXs3vo+jVXA5hsTsDHDsiYt1mFAQOMk0ZTXlEoaMNM3bNqsl2Vat+EHCa/O4eV0/h +3iHvsGwjfiAh8tlsFeuo2CTcyolU4SaWocKZEAXvITuwvzXcXVZz6O09dqWktgTxB2K2J nIoG2pRsi4ZqH9lONVUZGSGJq6bTw4w= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-85-0jYEWfLONWKQRObSQEorKQ-1; Fri, 09 Feb 2024 08:00:43 -0500 X-MC-Unique: 0jYEWfLONWKQRObSQEorKQ-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E55BB85A58B; Fri, 9 Feb 2024 13:00:42 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.39.192.58]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4C9A7AC1D; Fri, 9 Feb 2024 13:00:42 +0000 (UTC) From: Florian Weimer To: "H.J. Lu" Cc: libc-alpha@sourceware.org Subject: Re: [PATCH] elf: Properly remove the initial 'env' command References: <20240209125449.2352780-1-hjl.tools@gmail.com> Date: Fri, 09 Feb 2024 14:00:40 +0100 In-Reply-To: <20240209125449.2352780-1-hjl.tools@gmail.com> (H. J. Lu's message of "Fri, 9 Feb 2024 04:54:49 -0800") Message-ID: <87jznd7pxj.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.3 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,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 List-Id: * H. J. Lu: > index 9e70e74bf8..dfba94de64 100644 > --- a/elf/tst-rtld-list-diagnostics.py > +++ b/elf/tst-rtld-list-diagnostics.py > @@ -294,7 +294,11 @@ def main(argv): > check_consistency_with_manual(opts.manual) > > # Remove the initial 'env' command. > - parse_diagnostics(opts.command.split()[1:]) > + options = [] > + for o in opts.command.split()[0:]: > + if o != 'env': > + options.append(o) > + parse_diagnostics(options) I think you can write this as: options = opts.command.split()[:] options.remove('env') It only removes the first occurrence, but I think that is more correct anyway. Thanks, Florian