summaryrefslogtreecommitdiff
path: root/lib/quotearg.c
diff options
context:
space:
mode:
authorIgor Pashev <pashev.igor@gmail.com>2013-02-16 14:42:43 +0000
committerIgor Pashev <pashev.igor@gmail.com>2013-02-16 14:42:43 +0000
commit7548e75065063dae256d94e6c7f4f9f43bd7f210 (patch)
treef23b000f8822f6eb70249c1106a3275deaa03bac /lib/quotearg.c
parentddefcddae2e97579f82320f4fd70d0ba14a52392 (diff)
parent974ab3dd887985e3aa347f3c6521f819296396a0 (diff)
downloadcoreutils-7548e75065063dae256d94e6c7f4f9f43bd7f210.tar.gz
Merge tag 'upstream/8.21'
Upstream version 8.21
Diffstat (limited to 'lib/quotearg.c')
-rw-r--r--lib/quotearg.c24
1 files changed, 18 insertions, 6 deletions
diff --git a/lib/quotearg.c b/lib/quotearg.c
index 1ea583d9..57a83822 100644
--- a/lib/quotearg.c
+++ b/lib/quotearg.c
@@ -1,6 +1,6 @@
/* quotearg.c - quote arguments for output
- Copyright (C) 1998-2002, 2004-2012 Free Software Foundation, Inc.
+ Copyright (C) 1998-2002, 2004-2013 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
@@ -929,7 +929,7 @@ quotearg_custom_mem (char const *left_quote, char const *right_quote,
}
-/* The quoting option used by quote_n and quote. */
+/* The quoting option used by the functions of quote.h. */
struct quoting_options quote_quoting_options =
{
locale_quoting_style,
@@ -939,13 +939,25 @@ struct quoting_options quote_quoting_options =
};
char const *
-quote_n (int n, char const *name)
+quote_n_mem (int n, char const *arg, size_t argsize)
{
- return quotearg_n_options (n, name, SIZE_MAX, &quote_quoting_options);
+ return quotearg_n_options (n, arg, argsize, &quote_quoting_options);
}
char const *
-quote (char const *name)
+quote_mem (char const *arg, size_t argsize)
{
- return quote_n (0, name);
+ return quote_n_mem (0, arg, argsize);
+}
+
+char const *
+quote_n (int n, char const *arg)
+{
+ return quote_n_mem (n, arg, SIZE_MAX);
+}
+
+char const *
+quote (char const *arg)
+{
+ return quote_n (0, arg);
}