Combination of spaces and single backslash results in incorrect command-line-arguments

Bug #2051957 reported by Evgeny
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SBCL
Invalid
Undecided
Unassigned

Bug Description

- Windows 11 (Version 10.0.22631 Build 22631)
- SBCL 2.3.1

I am trying to use the "--script" option and pass some paths as arguments.

Given the following "test" script
test.lisp:
```lisp
(format t "~s~%" (cdr sb-ext:*posix-argv*))
```

Case 1
When calling it *from powershell* in the following way: `sbcl --script .\test.lisp "abc\"` it correctly interprets that it is 1 argument `("abc\\")` it also correctly escapes the `\`.

Case 2
Adding a space anywhere in first argument i.e. ``sbcl --script .\test.lisp "ab c\"`` attempts to escape the double-quote in the first arg resulting in the following output ("ab c\"").

I tried the tests from cmd.exe and in both cases the double-quote gets escaped instead of escaping `\`.

The issue only occurs if the `\` is before a double-quoute. This is true for both both environments (cmd.exe, powershell.exe).

running the same test in WSL works fine.

Revision history for this message
Evgeny (trismeg) wrote :

Apologies for filing this bug. This is related to how cmd.exe and powershell handle double-quotes and has nothing to do with sbcl. Marking as Invalid.

Changed in sbcl:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.