From c74a91deaa5de416237c02bbb3e41bda76ca4c7b Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Tue, 27 Nov 2018 21:35:56 +0100 Subject: support: Implement support_quote_string Reviewed-by: Jonathan Nieder --- support/support_quote_string.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 support/support_quote_string.c (limited to 'support/support_quote_string.c') diff --git a/support/support_quote_string.c b/support/support_quote_string.c new file mode 100644 index 0000000000..d324371b13 --- /dev/null +++ b/support/support_quote_string.c @@ -0,0 +1,26 @@ +/* Quote a string so that it can be used in C literals. + Copyright (C) 2018 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include +#include + +char * +support_quote_string (const char *str) +{ + return support_quote_blob (str, strlen (str)); +} -- cgit v1.2.3-70-g09d2