X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;ds=sidebyside;f=util%2Fstring-util.h;h=8a3ad19eae6e9808a319aec043e78089b792d41e;hb=029790d3ff6e9fccfed2214efac777b8c438e318;hp=0194607ee52877b9c1adcfc96933d84aab9658f1;hpb=998a8a95c3cd19950b78c50912345669952ba3eb;p=notmuch diff --git a/util/string-util.h b/util/string-util.h index 0194607e..8a3ad19e 100644 --- a/util/string-util.h +++ b/util/string-util.h @@ -19,6 +19,13 @@ char *strtok_len (char *s, const char *delim, size_t *len); +/* Return a talloced string with str sanitized. + * + * Whitespace characters (tabs and newlines) are replaced with spaces, + * non-printable characters with question marks. + */ +char *sanitize_string (const void *ctx, const char *str); + /* Construct a boolean term query with the specified prefix (e.g., * "id") and search term, quoting term as necessary. Specifically, if * term contains any non-printable ASCII characters, non-ASCII