diff options
author | Jim Meyering <jim@meyering.net> | 2000-07-15 09:57:19 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2000-07-15 09:57:19 +0000 |
commit | 4ee7d587046b30bb6c8f5cdb0e3118317fc0df83 (patch) | |
tree | 56edb1a1569646412af28a3542b3b1701b2df387 /lib | |
parent | a956a46792ddecaf1de82ebcdd8644bf5f9eca44 (diff) | |
download | coreutils-4ee7d587046b30bb6c8f5cdb0e3118317fc0df83.tar.xz |
(quote, quote_n): New file. Two functions taken verbatim
from tar's src/misc.c.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/quote.c | 25 |
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); +} |