aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2025-05-13 18:51:12 +0200
committerGitHub Enterprise <[email protected]>2025-05-13 18:51:12 +0200
commit4ca731fe4445f2c84582a80a7c635e3d736b3cf3 (patch)
tree5d6c2a7bfccb9f5b8f68940e7cdb62df78f7025f /src
parent5.6.8-pre1 (diff)
downloadzen-4ca731fe4445f2c84582a80a7c635e3d736b3cf3.tar.xz
zen-4ca731fe4445f2c84582a80a7c635e3d736b3cf3.zip
skip empty or single-space command line arguments (#393)
Diffstat (limited to 'src')
-rw-r--r--src/zen/zen.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/zen/zen.cpp b/src/zen/zen.cpp
index 7c21035c0..53fdf3d36 100644
--- a/src/zen/zen.cpp
+++ b/src/zen/zen.cpp
@@ -593,7 +593,11 @@ main(int argc, char** argv)
Args.reserve(argc);
for (int I = 0; I < argc; I++)
{
- Args.push_back(std::string(argv[I]));
+ std::string Arg(argv[I]);
+ if ((!Arg.empty()) && (Arg != " "))
+ {
+ Args.emplace_back(std::move(Arg));
+ }
}
#endif
std::vector<char*> RawArgs = zen::StripCommandlineQuotes(Args);