(quote, quote_n): New file. Two functions taken verbatim
authorJim Meyering <jim@meyering.net>
Sat, 15 Jul 2000 09:57:19 +0000 (09:57 +0000)
committerJim Meyering <jim@meyering.net>
Sat, 15 Jul 2000 09:57:19 +0000 (09:57 +0000)
from tar's src/misc.c.

lib/quote.c [new file with mode: 0644]

diff --git a/lib/quote.c b/lib/quote.c
new file mode 100644 (file)
index 0000000..fd1b57e
--- /dev/null
@@ -0,0 +1,25 @@
+/* Written by Paul Eggert <eggert@twinsun.com> */
+
+#if HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <sys/types.h>
+#include <quotearg.h>
+#include <quote.h>
+
+/* Return an unambiguous printable representated, allocated in slot N,
+   for NAME, 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);
+}