diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2021-06-30 18:55:17 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2021-07-01 11:06:04 -0700 |
commit | 0362c27fb373ea04eace9e7a70e61036ab81f09f (patch) | |
tree | bf77c5568394fe6da0ecd6ffdf57efa87d37fa53 /include | |
parent | a0809783355cfe1cc1b2fa7f881c3a79df0b2a27 (diff) | |
download | linux-0362c27fb373ea04eace9e7a70e61036ab81f09f.tar.bz2 |
lib/string_helpers: introduce ESCAPE_NAP to escape non-ASCII and non-printable
Some users may want to have an ASCII based filter for printable only
characters, provided by conjunction of isascii() and isprint() functions.
Here is the addition of a such.
Link: https://lkml.kernel.org/r/20210504180819.73127-6-andriy.shevchenko@linux.intel.com
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: Chuck Lever <chuck.lever@oracle.com>
Cc: "J. Bruce Fields" <bfields@fieldses.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/string_helpers.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/string_helpers.h b/include/linux/string_helpers.h index d6cf6fe10f74..811c6a627620 100644 --- a/include/linux/string_helpers.h +++ b/include/linux/string_helpers.h @@ -53,6 +53,7 @@ static inline int string_unescape_any_inplace(char *buf) #define ESCAPE_ANY_NP (ESCAPE_ANY | ESCAPE_NP) #define ESCAPE_HEX BIT(5) #define ESCAPE_NA BIT(6) +#define ESCAPE_NAP BIT(7) int string_escape_mem(const char *src, size_t isz, char *dst, size_t osz, unsigned int flags, const char *only); |