aboutsummaryrefslogtreecommitdiffstats
path: root/common/t-stringhelp.c
diff options
context:
space:
mode:
authorNIIBE Yutaka <[email protected]>2025-11-14 05:30:09 +0000
committerNIIBE Yutaka <[email protected]>2025-11-14 05:30:09 +0000
commit8a95e963d53a7ae1d74926d8d267ddd70dc1fb7c (patch)
treef7171a7c73661642fb7bbf639c9e3f6865bf9c3e /common/t-stringhelp.c
parentscd:nks: Make newer TCOS signature cards work. (diff)
downloadgnupg-8a95e963d53a7ae1d74926d8d267ddd70dc1fb7c.tar.gz
gnupg-8a95e963d53a7ae1d74926d8d267ddd70dc1fb7c.zip
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 <[email protected]>
Diffstat (limited to 'common/t-stringhelp.c')
-rw-r--r--common/t-stringhelp.c7
1 files changed, 5 insertions, 2 deletions
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;