diff options
author | Mikael Magnusson <mikachu@gmail.com> | 2014-11-06 16:06:23 +0100 |
---|---|---|
committer | Mikael Magnusson <mikachu@gmail.com> | 2014-11-07 11:10:30 +0100 |
commit | a9004ce32f79f2244f0882bd0e69248ea0c9c791 (patch) | |
tree | 9cf4e4131ad0132d07c5e5b0bb48e51a2989d84d /Src/Modules/socket.c | |
parent | 7abd611a2396bad9d93d18681a2c59cb1ea0e158 (diff) | |
download | zsh-a9004ce32f79f2244f0882bd0e69248ea0c9c791.tar.gz zsh-a9004ce32f79f2244f0882bd0e69248ea0c9c791.tar.xz zsh-a9004ce32f79f2244f0882bd0e69248ea0c9c791.zip |
33607: Fix some minor problems in zattr module
Remove the listattr call in zgetattr, it only caused no error to be output when trying to retrieve an xattr from a file with no xattrs. When a file had xattrs, it would just add an extra syscall for no good reason. Always set an array parameter in zlistattr, this makes the returned value much easier to use; in fact the _zattr completer didn't account for this and zlistattr foo <tab> on a file with only one attribute did not work. Almost all of the patch is only reindent, the only modification that's not a pure deletions is: - ret = 1 + (attr_len > val_len || attr_len < 0); + ret = 1 + ((val_len > 0 && attr_len > val_len) || attr_len < 0); which makes sure we return the correct error in the new path due to the removed listattr call. (If val_len is -1 due to no attribute existing, it doesn't mean the user should retry the call because the attribute grew in size).
Diffstat (limited to 'Src/Modules/socket.c')
0 files changed, 0 insertions, 0 deletions