summaryrefslogtreecommitdiff
path: root/setfattr
diff options
context:
space:
mode:
authorAndreas Gruenbacher <agruen@suse.de>2009-06-22 21:15:42 +0200
committerAndreas Gruenbacher <agruen@suse.de>2009-06-22 21:24:10 +0200
commit6824f9c68225388c8c7a9e887a21f0aa222c3571 (patch)
tree7aa061c6a9a654b2024807fc56d3b9ba46c73f71 /setfattr
parent2c66ff0decc062a99c038797013f1230cab73114 (diff)
downloadattr-6824f9c68225388c8c7a9e887a21f0aa222c3571.tar.gz
Stop quoting nonprintable characters in the getfattr output
What is printable or not depends on the locale settings, and getfattr often gets it wrong. We still need to quote a few special characters like newlines, and "=" in attribute names, so that setfattr can always parse getfattr's output.
Diffstat (limited to 'setfattr')
-rw-r--r--setfattr/setfattr.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/setfattr/setfattr.c b/setfattr/setfattr.c
index 0fe1927..491c25a 100644
--- a/setfattr/setfattr.c
+++ b/setfattr/setfattr.c
@@ -72,9 +72,9 @@ const char *strerror_ea(int err)
return strerror(err);
}
-static const char *xquote(const char *str)
+static const char *xquote(const char *str, const char *quote_chars)
{
- const char *q = quote(str);
+ const char *q = quote(str, quote_chars);
if (q == NULL) {
fprintf(stderr, "%s: %s\n", progname, strerror(errno));
exit(1);
@@ -276,7 +276,7 @@ int do_set(const char *path, const char *name, const char *value)
if (error < 0) {
fprintf(stderr, "%s: %s: %s\n",
- progname, xquote(path), strerror_ea(errno));
+ progname, xquote(path, "\n\r"), strerror_ea(errno));
had_errors++;
return 1;
}