summaryrefslogtreecommitdiffstats
path: root/contrib/cpio/lib/quote.c
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>2008-07-10 02:08:00 +0000
committerpeter <peter@FreeBSD.org>2008-07-10 02:08:00 +0000
commit5fd3bac82eb9e3ba73a8a18d9badc977aef7f6e5 (patch)
treec560fe69f2037481cd1e0ead005853b2b18de0bd /contrib/cpio/lib/quote.c
parentb07b40d7feb6ae8e188fa82622c29d6a0daeb94e (diff)
parent6ae22f7302b696d7694ae041817a4744a1476523 (diff)
downloadFreeBSD-src-5fd3bac82eb9e3ba73a8a18d9badc977aef7f6e5.zip
FreeBSD-src-5fd3bac82eb9e3ba73a8a18d9badc977aef7f6e5.tar.gz
Merge gnu cpio 2.6 -> 2.8 changes. Unfortunately, we have massive
conflicts due to radically different approaches to security and bug fixes. In some cases I re-started from the vendor version and reimplemented our patches. Fortunately, this is not enabled by default in -current.
Diffstat (limited to 'contrib/cpio/lib/quote.c')
-rw-r--r--contrib/cpio/lib/quote.c41
1 files changed, 41 insertions, 0 deletions
diff --git a/contrib/cpio/lib/quote.c b/contrib/cpio/lib/quote.c
new file mode 100644
index 0000000..119be72
--- /dev/null
+++ b/contrib/cpio/lib/quote.c
@@ -0,0 +1,41 @@
+/* quote.c - quote arguments for output
+
+ Copyright (C) 1998, 1999, 2000, 2001, 2003, 2005, 2006 Free
+ Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program 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 General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
+
+/* Written by Paul Eggert <eggert@twinsun.com> */
+
+#include <config.h>
+
+#include "quotearg.h"
+#include "quote.h"
+
+/* Return an unambiguous printable representation of NAME,
+ allocated in slot N, suitable for diagnostics. */
+char const *
+quote_n (int n, char const *name)
+{
+ return quotearg_n_style (n, locale_quoting_style, name);
+}
+
+/* Return an unambiguous printable representation of NAME,
+ suitable for diagnostics. */
+char const *
+quote (char const *name)
+{
+ return quote_n (0, name);
+}
OpenPOWER on IntegriCloud