summaryrefslogtreecommitdiff
path: root/lib/quote.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2000-07-15 09:57:19 +0000
committerJim Meyering <jim@meyering.net>2000-07-15 09:57:19 +0000
commit4ee7d587046b30bb6c8f5cdb0e3118317fc0df83 (patch)
tree56edb1a1569646412af28a3542b3b1701b2df387 /lib/quote.c
parenta956a46792ddecaf1de82ebcdd8644bf5f9eca44 (diff)
downloadcoreutils-4ee7d587046b30bb6c8f5cdb0e3118317fc0df83.tar.xz
(quote, quote_n): New file. Two functions taken verbatim
from tar's src/misc.c.
Diffstat (limited to 'lib/quote.c')
-rw-r--r--lib/quote.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/lib/quote.c b/lib/quote.c
new file mode 100644
index 000000000..fd1b57e92
--- /dev/null
+++ b/lib/quote.c
@@ -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);
+}