]> 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)
commit86856f8f0c7530e1a29aa3fe6ae76ad027b2e6f0
tree050650d45d87d430334939f0552deafbe36561f9
parentb703587852d54e29447960b2656c11f79e2f18a9
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