From 8a95e963d53a7ae1d74926d8d267ddd70dc1fb7c Mon Sep 17 00:00:00 2001 From: NIIBE Yutaka Date: Fri, 14 Nov 2025 14:30:09 +0900 Subject: common: Fix the test of t-stringhelp. * common/t-stringhelp.c (stresc): Don't put newline when escaped. -- Reported-by: 8b79fe4dd0581c1cd000e1fbecba9f39e16a396a Signed-off-by: NIIBE Yutaka --- common/t-stringhelp.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'common/t-stringhelp.c') diff --git a/common/t-stringhelp.c b/common/t-stringhelp.c index 6723d65b6..b43bb7932 100644 --- a/common/t-stringhelp.c +++ b/common/t-stringhelp.c @@ -978,6 +978,10 @@ test_split_fields_colon (void) } +/* + * Escape the newline control character. + * Replace the space into underscore character. + */ static char * stresc (char *s) { @@ -996,8 +1000,7 @@ stresc (char *s) else if (*p == '\n') { p[l ++] = '\\'; - p[l ++] = 'n'; - p[l] = '\n'; + p[l] = 'n'; } else p[l] = *s; -- cgit