From 155aa2866a4a78a3897a4710d29179b7ed492500 Mon Sep 17 00:00:00 2001 From: "Ilmar S. Habibulin" <161701313+ngr-ilmarh@users.noreply.github.com> Date: Tue, 29 Apr 2025 15:38:10 +0300 Subject: [PATCH] fix #8807 --- .../java/org/jruby/util/io/PopenExecutor.java | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/core/src/main/java/org/jruby/util/io/PopenExecutor.java b/core/src/main/java/org/jruby/util/io/PopenExecutor.java index 659e37a403c..e729e986b38 100644 --- a/core/src/main/java/org/jruby/util/io/PopenExecutor.java +++ b/core/src/main/java/org/jruby/util/io/PopenExecutor.java @@ -564,17 +564,19 @@ private RubyIO pipeOpen(ThreadContext context, ExecArg eargp, String modestr, in if (prog != null) cmd = checkEmbeddedNulls(context, prog).toString(); - if (eargp.chdirGiven) { - // we can'd do chdir with posix_spawn, so we should be set to use_shell and now - // just need to add chdir to the cmd - cmd = "cd '" + eargp.chdir_dir + "'; " + cmd; - eargp.chdir_dir = null; - eargp.chdirGiven = false; - } - - if (eargp != null && !eargp.use_shell) { - args = eargp.argv_str.argv; - } + if (eargp != null) { + if (eargp.chdirGiven) { + // we can'd do chdir with posix_spawn, so we should be set to use_shell and now + // just need to add chdir to the cmd + cmd = "cd '" + eargp.chdir_dir + "'; " + cmd; + eargp.chdir_dir = null; + eargp.chdirGiven = false; + } + + if (!eargp.use_shell) { + args = eargp.argv_str.argv; + } + } int[] pair = {-1,-1}, writePair = {-1, -1}; switch (fmode & (OpenFile.READABLE|OpenFile.WRITABLE)) { case OpenFile.READABLE | OpenFile.WRITABLE: pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy