]> git.baikalelectronics.ru Git - kernel.git/commit
lib / string_helpers: introduce string_escape_mem()
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Mon, 13 Oct 2014 22:55:16 +0000 (15:55 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 14 Oct 2014 00:18:26 +0000 (02:18 +0200)
commit2b49c46350ff5c1acd13ccb66aad36b19c31b227
tree050650d45d87d430334939f0552deafbe36561f9
parent35d118aec927d9cf6c026b8c39d4c30ed7bbae1f
lib / string_helpers: introduce string_escape_mem()

This is almost the opposite function to string_unescape().  Nevertheless
it handles \0 and could be used for any byte buffer.

The documentation is supplied together with the function prototype.

The test cases covers most of the scenarios and would be expanded later
on.

[akpm@linux-foundation.org: avoid 1k stack consumption]
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: "John W . Linville" <linville@tuxdriver.com>
Cc: Johannes Berg <johannes@sipsolutions.net>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Joe Perches <joe@perches.com>
Cc: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
include/linux/string_helpers.h
lib/string_helpers.c
lib/test-string_helpers.c