Skip to content

Commit bf93fd3

Browse files
committed
slash: remove trailing space after echo output
The echo function also inadvertently used printf directly, instead of slash_printf. Signed-off-by: Jeppe Ledet-Pedersen <jlp@satlab.com>
1 parent ca8c93c commit bf93fd3

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/slash.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1321,10 +1321,13 @@ static int slash_builtin_echo(struct slash *slash)
13211321
{
13221322
int i;
13231323

1324-
for (i = 1; i < slash->argc; i++)
1325-
printf("%s ", slash->argv[i]);
1324+
for (i = 1; i < slash->argc; i++) {
1325+
slash_printf(slash, "%s", slash->argv[i]);
1326+
if (i + 1 < slash->argc)
1327+
slash_printf(slash, " ");
1328+
}
13261329

1327-
printf("\n");
1330+
slash_printf(slash, "\n");
13281331

13291332
return SLASH_SUCCESS;
13301333
}

0 commit comments

Comments
 (0)