We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8f56f3d commit 4c2e74dCopy full SHA for 4c2e74d
2 files changed
src/foundation/str_util.c
@@ -249,6 +249,7 @@ bool cbm_validate_shell_arg(const char *s) {
249
case '`':
250
case '\n':
251
case '\r':
252
+ return false;
253
#ifndef _WIN32
254
case '\\':
255
return false;
tests/test_str_util.c
@@ -405,7 +405,12 @@ TEST(validate_shell_arg_carriage_return) {
405
}
406
407
TEST(validate_shell_arg_backslash) {
408
+#ifdef _WIN32
409
+ /* Backslash is allowed on Windows (path separator) */
410
+ ASSERT_TRUE(cbm_validate_shell_arg("path\\to\\file"));
411
+#else
412
ASSERT_FALSE(cbm_validate_shell_arg("path\\to\\file"));
413
+#endif
414
PASS();
415
416
0 commit comments