xiterm

simple vte terminal emulator
git clone https://git.ce9e.org/xiterm.git

commit
7b85068cf06e41bcddd3555ed62bba8ed24b4e80
parent
e57e34ba526dcf555b77c036a9eddf1b12216203
Author
Tobias Bengfort <tobias.bengfort@posteo.de>
Date
2023-11-16 08:03
revert/fixup 564019a: join -c arguments with spaces

the goal is that both `xiterm -e sleep 1` and `xiterm -e 'sh -c "sleep 1"'` work

Diffstat

M xiterm.c 5 +++--

1 files changed, 3 insertions, 2 deletions


diff --git a/xiterm.c b/xiterm.c

@@ -204,9 +204,10 @@ int main(int argc, char **argv) {
  204   204 			exit(EXIT_FAILURE);
  205   205 		}
  206   206 		for (i = 2; i < argc; i++) {
  207    -1 			strncat(command, "\"", 128 - 1 - strlen(command));
  208   207 			strncat(command, argv[i], 128 - 1 - strlen(command));
  209    -1 			strncat(command, "\" ", 128 - 1 - strlen(command));
   -1   208 			if (i + 1 < argc) {
   -1   209 				strncat(command, " ", 128 - 1 - strlen(command));
   -1   210 			}
  210   211 		}
  211   212 		cmd[0] = "/bin/sh";
  212   213 		cmd[1] = "-c";