This is an automated email from the git hooks/post-receive script.
git pushed a commit to branch master
in repository e16.
View the commit online.
commit f9f21a149a565d859b35ef79856bdb88c1171bc2
Author: Kim Woelders <[email protected]>
AuthorDate: Tue Oct 4 11:02:40 2022 +0200
eesh: Improve argument passing
Quote arguments containing spaces.
---
eesh/main.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/eesh/main.c b/eesh/main.c
index aeab0c79..c66a3932 100644
--- a/eesh/main.c
+++ b/eesh/main.c
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2000-2007 Carsten Haitzler, Geoff Harrison and various contributors
- * Copyright (C) 2004-2020 Kim Woelders
+ * Copyright (C) 2004-2022 Kim Woelders
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
@@ -171,12 +171,16 @@ main(int argc, char **argv)
len = 0;
for (; i < argc; i++)
{
- l = strlen(argv[i]);
- command = EREALLOC(char, command, len + l + 2);
+ s = argv[i];
+ l = strlen(s);
+ command = EREALLOC(char, command, len + l + 4);
if (len)
command[len++] = ' ';
- strcpy(command + len, argv[i]);
+ if (strchr(s, ' '))
+ l = snprintf(command + len, l + 4, "'%s'", s);
+ else
+ l = snprintf(command + len, l + 4, "%s", s);
len += l;
}
}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.