diff options
author | Peter Stephenson <pws@users.sourceforge.net> | 2006-05-30 22:35:03 +0000 |
---|---|---|
committer | Peter Stephenson <pws@users.sourceforge.net> | 2006-05-30 22:35:03 +0000 |
commit | dd5602f59b599177fb130512fc543f7efa951990 (patch) | |
tree | 93f50c0abbbc61dbea120afb6f497afe6b976fea /Src/Modules/files.c | |
parent | fd240e09b05ca15aa1deef35733124b6852fe809 (diff) | |
download | zsh-dd5602f59b599177fb130512fc543f7efa951990.tar.gz zsh-dd5602f59b599177fb130512fc543f7efa951990.tar.xz zsh-dd5602f59b599177fb130512fc543f7efa951990.zip |
22474: use variable argument lists to improve error message handling
Diffstat (limited to 'Src/Modules/files.c')
-rw-r--r-- | Src/Modules/files.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/Src/Modules/files.c b/Src/Modules/files.c index 331507c64..079aeac4d 100644 --- a/Src/Modules/files.c +++ b/Src/Modules/files.c @@ -78,7 +78,7 @@ bin_mkdir(char *nam, char **args, Options ops, UNUSED(int func)) mode = zstrtol(str, &ptr, 8); if(!*str || *ptr) { - zwarnnam(nam, "invalid mode `%s'", str, 0); + zwarnnam(nam, "invalid mode `%s'", str); return 1; } } @@ -214,7 +214,7 @@ bin_ln(char *nam, char **args, Options ops, int func) goto havedir; } if(a > args+1) { - zwarnnam(nam, "last of many arguments must be a directory", NULL, 0); + zwarnnam(nam, "last of many arguments must be a directory"); return 1; } if(!args[1]) { @@ -266,7 +266,7 @@ domove(char *nam, MoveFunc move, char *p, char *q, int flags) if(!lstat(qbuf, &st)) { int doit = flags & MV_FORCE; if(S_ISDIR(st.st_mode)) { - zwarnnam(nam, "%s: cannot overwrite directory", q, 0); + zwarnnam(nam, "%s: cannot overwrite directory", q); zsfree(pbuf); return 1; } else if(flags & MV_INTER) { @@ -469,7 +469,7 @@ recursivecmd_dorec(struct recursivecmd const *reccmd, if (restoredir(ds)) { if(!reccmd->opt_noerr) zwarnnam(reccmd->nam, "failed to return to previous directory: %e", - NULL, errno); + errno); return 2; } return err | reccmd->dirpost_func(arg, rp, sp, reccmd->magic); @@ -647,7 +647,7 @@ bin_chown(char *nam, char **args, Options ops, int func) int err; chm.uid = getnumeric(p, &err); if(err) { - zwarnnam(nam, "%s: no such user", p, 0); + zwarnnam(nam, "%s: no such user", p); free(uspec); return 1; } @@ -656,7 +656,7 @@ bin_chown(char *nam, char **args, Options ops, int func) p = end+1; if(!*p) { if(!pwd && !(pwd = getpwuid(chm.uid))) { - zwarnnam(nam, "%s: no such user", uspec, 0); + zwarnnam(nam, "%s: no such user", uspec); free(uspec); return 1; } @@ -673,7 +673,7 @@ bin_chown(char *nam, char **args, Options ops, int func) int err; chm.gid = getnumeric(p, &err); if(err) { - zwarnnam(nam, "%s: no such group", p, 0); + zwarnnam(nam, "%s: no such group", p); free(uspec); return 1; } |