From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS4713 221.184.0.0/13 X-Spam-Status: No, score=-3.6 required=3.0 tests=AWL,BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS, UNPARSEABLE_RELAY shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from neon.ruby-lang.org (neon.ruby-lang.org [221.186.184.75]) by dcvr.yhbt.net (Postfix) with ESMTP id 77F7F1F5AE for ; Fri, 30 Apr 2021 14:45:44 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 335EC1210C3; Fri, 30 Apr 2021 23:44:34 +0900 (JST) Received: from o1678948x4.outbound-mail.sendgrid.net (o1678948x4.outbound-mail.sendgrid.net [167.89.48.4]) by neon.ruby-lang.org (Postfix) with ESMTPS id D82BD1210C2 for ; Fri, 30 Apr 2021 23:44:30 +0900 (JST) Received: by filterdrecv-6bd97c8c5f-p4nzn with SMTP id filterdrecv-6bd97c8c5f-p4nzn-1-608C180B-D5 2021-04-30 14:45:31.752271506 +0000 UTC m=+149189.542908740 Received: from herokuapp.com (unknown) by geopod-ismtpd-5-2 (SG) with ESMTP id rYFbua09SheGEUfIZzFxqQ for ; Fri, 30 Apr 2021 14:45:31.679 +0000 (UTC) Date: Fri, 30 Apr 2021 14:45:31 +0000 (UTC) From: v.ondruch@tiscali.cz Message-ID: References: Mime-Version: 1.0 X-Redmine-Project: ruby-master X-Redmine-Issue-Tracker: Bug X-Redmine-Issue-Id: 16798 X-Redmine-Issue-Author: deivid X-Redmine-Sender: vo.x X-Mailer: Redmine X-Redmine-Host: bugs.ruby-lang.org X-Redmine-Site: Ruby Issue Tracking System X-Auto-Response-Suppress: All Auto-Submitted: auto-generated X-Redmine-MailingListIntegration-Message-Ids: 79721 X-SG-EID: =?us-ascii?Q?mWhqNvD1xlBozk4zn6CTHlnSPHlTKkyHJdiOH=2FzC52jM76qKSqMjPceatVMOIN?= =?us-ascii?Q?3sNMZuleOFlRKyaXAoDwEiT8Xhg6iQNFSdsEuUS?= =?us-ascii?Q?KhLzJwaJ1E1cEBCmroRBcLjg70E516pLRLJCN=2Fn?= =?us-ascii?Q?obAVOlCPbweSd8SZE6qemWLnEZ=2FIizv+WcJeNhE?= =?us-ascii?Q?HDOjFKd9+gAk0ZsOKU0CwdRCY5qIbTeCCtg=3D=3D?= To: ruby-core@ruby-lang.org X-Entity-ID: b/2+PoftWZ6GuOu3b0IycA== X-ML-Name: ruby-core X-Mail-Count: 103674 Subject: [ruby-core:103674] [Ruby master Bug#16798] ENV.replace on Windows with a variable name not respecting case will clear it X-BeenThere: ruby-core@ruby-lang.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Ruby developers List-Id: Ruby developers List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Errors-To: ruby-core-bounces@ruby-lang.org Sender: "ruby-core" Issue #16798 has been updated by vo.x (Vit Ondruch). The backport breaks on RHEL7: ~~~ hash.c: In function 'keylist_delete': hash.c:5661:5: error: 'for' loop initial declarations are only allowed in C= 99 mode for (long i=3D0; i ruby -e "puts ENV['Path']; ENV['PATH'] =3D 'foo'; puts E= NV['Path']" = = C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Window= s\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program = Files\Git\cmd;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin= ;C:\Ruby26-x64\bin;C:\Ruby25-x64\bin;C:\Windows\system32;C:\Windows;C:\Wind= ows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\Sy= stem32\OpenSSH\;C:\Program Files\Git\cmd;C:\Program Files\Git\mingw64\bin;C= :\Program Files\Git\usr\bin;C:\Windows\system32;C:\Windows;C:\Windows\Syste= m32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\Op= enSSH\;C:\Program Files\Git\cmd;C:\Program Files\Git\mingw64\bin;C:\Program= Files\Git\usr\bin;C:\Ruby27-x64\bin;C:\Ruby25-x64\bin foo PS C:\Users\deivi> ruby -e "puts ENV['Path']; ENV.update('PATH' =3D> 'foo')= ; puts ENV['Path']" = = C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Window= s\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program = Files\Git\cmd;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin= ;C:\Ruby26-x64\bin;C:\Ruby25-x64\bin;C:\Windows\system32;C:\Windows;C:\Wind= ows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\Sy= stem32\OpenSSH\;C:\Program Files\Git\cmd;C:\Program Files\Git\mingw64\bin;C= :\Program Files\Git\usr\bin;C:\Windows\system32;C:\Windows;C:\Windows\Syste= m32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\Op= enSSH\;C:\Program Files\Git\cmd;C:\Program Files\Git\mingw64\bin;C:\Program= Files\Git\usr\bin;C:\Ruby27-x64\bin;C:\Ruby25-x64\bin foo ``` However, with `ENV.replace`, if you don't use the "canonical casing" (as gi= ven by `ENV.keys`, for example), the environment variable will be cleared. ``` PS C:\Users\deivi> ruby -e "puts ENV['Path']; ENV.replace('PATH' =3D> 'foo'= ); puts ENV['Path']" = = C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\W= indows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Pro= gram Files\Git\cmd;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\us= r\bin;C:\Ruby26-x64\bin;C:\Ruby25-x64\bin;C:\Windows\system32;C:\Windows;C:= \Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windo= ws\System32\OpenSSH\;C:\Program Files\Git\cmd;C:\Program Files\Git\mingw64\= bin;C:\Program Files\Git\usr\bin;C:\Windows\system32;C:\Windows;C:\Windows\= System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System= 32\OpenSSH\;C:\Program Files\Git\cmd;C:\Program Files\Git\mingw64\bin;C:\Pr= ogram Files\Git\usr\bin;C:\Ruby27-x64\bin;C:\Ruby25-x64\bin ``` This is unexpected to me. -- = https://bugs.ruby-lang.org/ Unsubscribe: