PATCH: attr: various minor issues

Mikael Magnusson <[email protected]>
Newsgroups gmane.comp.shells.zsh.devel
Message-ID <[email protected]>
The flags parameter is always 0 so the precedence mistake doesn't
actually matter.

Attributes are quite unlikely to be over 2GB in length, but use the
correct types.

The module is load=no so the autofeatures isn't used, but be consistent
and list all builtins in the mdd file.
---
 Src/Modules/attr.c   | 8 +++++---
 Src/Modules/attr.mdd | 2 +-
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/Src/Modules/attr.c b/Src/Modules/attr.c
index f4bd049827..dd29e42f6d 100644
--- a/Src/Modules/attr.c
+++ b/Src/Modules/attr.c
@@ -68,7 +68,7 @@ xsetxattr(const char *path, const char *name, const void *value,
           size_t size, int flags, int symlink)
 {
 #ifdef XATTR_EXTRA_ARGS
-    return setxattr(path, name, value, size, 0, flags | symlink ? XATTR_NOFOLLOW : 0);
+    return setxattr(path, name, value, size, 0, flags | (symlink ? XATTR_NOFOLLOW : 0));
 #else
     switch (symlink) {
     case 0:
@@ -98,7 +98,8 @@ static int
 bin_getattr(char *nam, char **argv, Options ops, UNUSED(int func))
 {
     int ret = 0;
-    int val_len = 0, attr_len = 0, slen;
+    int slen;
+    ssize_t val_len = 0, attr_len = 0;
     char *value, *file = argv[0], *attr = argv[1], *param = argv[2];
     int symlink = OPT_ISSET(ops, 'h');
 
@@ -169,7 +170,8 @@ static int
 bin_listattr(char *nam, char **argv, Options ops, UNUSED(int func))
 {
     int ret = 0;
-    int val_len, list_len = 0, slen;
+    int slen;
+    ssize_t val_len, list_len = 0;
     char *value, *file = argv[0], *param = argv[1];
     int symlink = OPT_ISSET(ops, 'h');
 
diff --git a/Src/Modules/attr.mdd b/Src/Modules/attr.mdd
index fbe917bbf0..3b765f4890 100644
--- a/Src/Modules/attr.mdd
+++ b/Src/Modules/attr.mdd
@@ -7,6 +7,6 @@ fi
 '
 load=no
 
-autofeatures="b:zgetattr b:zsetattr b:zdelattr"
+autofeatures="b:zgetattr b:zsetattr b:zdelattr b:zlistattr"
 
 objects="attr.o"
-- 
2.38.1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.