summaryrefslogtreecommitdiff
path: root/sfeed_opml_import.c
diff options
context:
space:
mode:
authorHiltjo Posthuma <hiltjo@codemadness.org>2018-06-24 15:17:04 +0200
committerHiltjo Posthuma <hiltjo@codemadness.org>2018-06-24 15:17:04 +0200
commit09160d2f4e699a72ccbb58c76b32a6670d965860 (patch)
treed581f5671d1eaa798de1754cd9b7353e6cfbbc1a /sfeed_opml_import.c
parent9c05ddec777c0b43f19f9d277f7167b8feb23456 (diff)
sfeed_opml_import: escape ' properly
the shell escape \' was a mistake.
Diffstat (limited to 'sfeed_opml_import.c')
-rw-r--r--sfeed_opml_import.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/sfeed_opml_import.c b/sfeed_opml_import.c
index 4c57b20..6fd51eb 100644
--- a/sfeed_opml_import.c
+++ b/sfeed_opml_import.c
@@ -21,9 +21,12 @@ printsafe(const char *s)
for (; *s; s++) {
if (iscntrl((int)*s))
continue;
- if (*s == '\\' || *s == '\'')
- putchar('\\');
- putchar((int)*s);
+ else if (*s == '\\')
+ fputs("\\\\", stdout);
+ else if (*s == '\'')
+ fputs("'\\''", stdout);
+ else
+ putchar((int)*s);
}
}