diff options
author | Jim Meyering <jim@meyering.net> | 2000-07-30 16:28:25 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2000-07-30 16:28:25 +0000 |
commit | 76bc5dc396bbc8c08fba4f7342548148bbe7e6a1 (patch) | |
tree | 3fadf5c528fb9d796e7d729223490f6030010a37 /src/du.c | |
parent | fb61cfca0001aa64b7e3954e6d3eff2282f1d89b (diff) | |
download | coreutils-76bc5dc396bbc8c08fba4f7342548148bbe7e6a1.tar.xz |
Convert "`%s'" in format strings to "%s", and wrap each
corresponding argument in a `quote (...)' call.
Diffstat (limited to 'src/du.c')
-rw-r--r-- | src/du.c | 14 |
1 files changed, 8 insertions, 6 deletions
@@ -55,6 +55,7 @@ #include "error.h" #include "exclude.h" #include "human.h" +#include "quote.h" #include "save-cwd.h" #include "savedir.h" #include "xstrtol.h" @@ -471,7 +472,7 @@ pop_dir (struct saved_cwd *cwd, const char *curr_dir_name) else if (chdir ("..") < 0) { error (1, errno, _("cannot change to `..' from directory %s"), - curr_dir_name); + quote (curr_dir_name)); } } @@ -494,7 +495,7 @@ count_entry (const char *ent, int top, dev_t last_dev, int depth) ? stat (ent, &stat_buf) : (*xstat) (ent, &stat_buf)) < 0) { - error (0, errno, "%s", path->text); + error (0, errno, "%s", quote (path->text)); exit_status = 1; return 0; } @@ -543,7 +544,8 @@ count_entry (const char *ent, int top, dev_t last_dev, int depth) if (chdir (ent) < 0) { - error (0, errno, _("cannot change to directory %s"), path->text); + error (0, errno, _("cannot change to directory %s"), + quote (path->text)); if (cwd) free_cwd (cwd); exit_status = 1; @@ -553,7 +555,7 @@ count_entry (const char *ent, int top, dev_t last_dev, int depth) name_space = savedir (".", stat_buf.st_size); if (name_space == NULL) { - error (0, errno, "%s", path->text); + error (0, errno, "%s", quote (path->text)); pop_dir (cwd, path->text); exit_status = 1; return 0; @@ -693,7 +695,7 @@ main (int argc, char **argv) case MAX_DEPTH_OPTION: /* --max-depth=N */ if (xstrtol (optarg, NULL, 0, &tmp_long, NULL) != LONGINT_OK || tmp_long < 0 || tmp_long > INT_MAX) - error (1, 0, _("invalid maximum depth `%s'"), optarg); + error (1, 0, _("invalid maximum depth %s"), quote (optarg)); max_depth_specified = 1; max_depth = (int) tmp_long; @@ -729,7 +731,7 @@ main (int argc, char **argv) case 'X': if (add_exclude_file (add_exclude, exclude, optarg, '\n') != 0) - error (1, errno, "%s", optarg); + error (1, errno, "%s", quote (optarg)); break; case EXCLUDE_OPTION: |