]> git.cworth.org Git - notmuch/blobdiff - notmuch-search.c
cli: sanitize tabs and newlines to spaces in notmuch search
[notmuch] / notmuch-search.c
index 91b5d10596dc987cd8b3bafb18dadb17f57a7384..0262eb30a1f96829141b4fd6cc7b20ecf141ff2e 100644 (file)
@@ -41,7 +41,9 @@ sanitize_string (const void *ctx, const char *str)
     loop = out = talloc_strdup (ctx, str);
 
     for (; *loop; loop++) {
-       if ((unsigned char)(*loop) < 32)
+       if (*loop == '\t' || *loop == '\n')
+           *loop = ' ';
+       else if ((unsigned char)(*loop) < 32)
            *loop = '?';
     }
     return out;