We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e7d9711 commit 0fb001cCopy full SHA for 0fb001c
1 file changed
src/main.rs
@@ -116,7 +116,7 @@ fn format_argument(arg: String) -> String {
116
if arg.contains(quote_characters) {
117
// if argument contains quotes then assume it is correctly quoted.
118
return arg;
119
- } else if arg.contains(invalid_characters) {
+ } else if arg.contains(invalid_characters) || arg.is_empty() {
120
return format!("\"{}\"", arg);
121
} else {
122
@@ -354,6 +354,11 @@ mod tests {
354
assert_eq!(format_argument("--abc|def".to_string()), "\"--abc|def\"");
355
}
356
357
+ #[test]
358
+ fn format_empty_argument() {
359
+ assert_eq!(format_argument("".to_string()), "\"\"");
360
+ }
361
+
362
#[test]
363
fn win_to_unix_path_trans() {
364
env::remove_var("WSLGIT_MOUNT_ROOT");
0 commit comments