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=-4.1 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, SPF_PASS 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 CC2C11F770 for ; Wed, 2 Jan 2019 17:00:56 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id BA2D1121B4B; Thu, 3 Jan 2019 02:00:53 +0900 (JST) Received: from o1678916x28.outbound-mail.sendgrid.net (o1678916x28.outbound-mail.sendgrid.net [167.89.16.28]) by neon.ruby-lang.org (Postfix) with ESMTPS id 4F44F121B4A for ; Thu, 3 Jan 2019 02:00:49 +0900 (JST) Received: by filter0148p3las1.sendgrid.net with SMTP id filter0148p3las1-10528-5C2CEE3C-12 2019-01-02 17:00:44.193093574 +0000 UTC m=+1103794.733278780 Received: from herokuapp.com (ec2-54-162-14-204.compute-1.amazonaws.com [54.162.14.204]) by ismtpd0008p1iad2.sendgrid.net (SG) with ESMTP id NwJQkiCfQgOjlr3g-5aOBA for ; Wed, 02 Jan 2019 17:00:44.072 +0000 (UTC) Date: Wed, 02 Jan 2019 17:00:45 +0000 (UTC) From: justin@presidentbeef.com To: ruby-core@ruby-lang.org Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 66282 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 8028 X-Redmine-Issue-Author: Shagabutdinov X-Redmine-Sender: jsc 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-SG-EID: ync6xU2WACa70kv/Ymy4QrNMhiuLXJG8OTL2vJD1yS5NYwGq0XHNn/Rcw2VUS9jewuJbv1WsrUgVOq tt8dARMlKOe8MpWzLxAhFo6Ca3yUx9iDdCdma6oTV6hVMrHiokpaHjGGDVyw+goBRN8CVUzI8ms6Ip cLpkEt7fFT23Epsdl9RJyqKHA9S124hQ3Gx5tyT7f6o356Tgsp6y5UP5CA== X-ML-Name: ruby-core X-Mail-Count: 90858 Subject: [ruby-core:90858] [Ruby trunk Bug#8028] Shellwords.escape works incorrect under windows 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="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ruby-core-bounces@ruby-lang.org Sender: "ruby-core" Issue #8028 has been updated by jsc (Justin Collins). Shagabutdinov (Leonid Shagabutdinov) wrote: > Shellwords.escape works incorrect under windows (tested for Windows 7 I don't believe `Shellwords` is intended to work on Windows at all. According to the comments (https://github.com/ruby/ruby/blob/ee2ddf5411f51ea89a1569ea5d70b41cd4c6c7f2/lib/shellwords.rb#L3-L6): ~~~ # == Manipulates strings like the UNIX Bourne shell # # This module manipulates strings according to the word parsing rules # of the UNIX Bourne shell. ~~~ ---------------------------------------- Bug #8028: Shellwords.escape works incorrect under windows https://bugs.ruby-lang.org/issues/8028#change-76044 * Author: Shagabutdinov (Leonid Shagabutdinov) * Status: Open * Priority: Normal * Assignee: * Target version: * ruby -v: ruby 2.0.0p0 (2013-02-24) [i386-mingw32] * Backport: 2.4: UNKNOWN, 2.5: UNKNOWN, 2.6: UNKNOWN ---------------------------------------- Shellwords.escape works incorrect under windows (tested for Windows 7 x64), here is example: Actual result: irb(main):001:0> require 'shellwords' => true irb(main):002:0> `echo #{Shellwords.escape( '123>' )} test` # should echo "123> test", but echo nothing => "" irb(main):003:0> File.read( 'test' ) # but writes file "test" => "123\\\n" Expected result: irb(main):001:0> `echo 132^> test` # the correct escape sequence, echoed "123> test" => "132> test\n" Tested for "ruby 2.0.0p0 (2013-02-24) [i386-mingw32]", ruby 1.9.3, but this bug can be found in earlier ruby versions as well. -- https://bugs.ruby-lang.org/