diff options
author | Jim Meyering <jim@meyering.net> | 2000-07-15 10:11:18 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2000-07-15 10:11:18 +0000 |
commit | 7f8c02a4fbfb5134a6e2e432371849a8edc44a0a (patch) | |
tree | af3d4f2743bba9096631d9a25c7899fed92fffd2 /src | |
parent | 2b4d17755338e30b4c8f128d8e5d8ee4b9ecf06d (diff) | |
download | coreutils-7f8c02a4fbfb5134a6e2e432371849a8edc44a0a.tar.xz |
Convert "`%s'" in format strings to "%s", and wrap each
corresponding argument in a `quote (...)' call -- if there's only one.
If there are more than one, then use `quote_n (0, ...),
quote_n (1, ...), ...'.
Diffstat (limited to 'src')
-rw-r--r-- | src/cp.c | 16 |
1 files changed, 10 insertions, 6 deletions
@@ -35,6 +35,7 @@ #include "error.h" #include "dirname.h" #include "path-concat.h" +#include "quote.h" /* The official name of this program (e.g., no `g' prefix). */ #define PROGRAM_NAME "cp" @@ -371,7 +372,8 @@ make_path_private (const char *const_dirpath, int src_offset, int mode, new->is_new_dir = 1; if (mkdir (dirpath, mode)) { - error (0, errno, _("cannot make directory `%s'"), dirpath); + error (0, errno, _("cannot make directory %s"), + quote (dirpath)); return 1; } else @@ -382,7 +384,8 @@ make_path_private (const char *const_dirpath, int src_offset, int mode, } else if (!S_ISDIR (stats.st_mode)) { - error (0, 0, _("`%s' exists but is not a directory"), dirpath); + error (0, 0, _("%s exists but is not a directory"), + quote (dirpath)); return 1; } else @@ -403,7 +406,7 @@ make_path_private (const char *const_dirpath, int src_offset, int mode, else if (!S_ISDIR (stats.st_mode)) { - error (0, 0, _("`%s' exists but is not a directory"), dst_dirname); + error (0, 0, _("%s exists but is not a directory"), quote (dst_dirname)); return 1; } else @@ -472,15 +475,16 @@ do_copy (int n_files, char **file, const char *target_directory, { if (target_directory) { - error (0, 0, _("specified target, `%s' is not a directory"), dest); + error (0, 0, _("specified target, %s is not a directory"), + quote (dest)); usage (1); } if (n_files > 1) { error (0, 0, - _("copying multiple files, but last argument (%s) is not a directory"), - dest); + _("copying multiple files, but last argument %s is not a directory"), + quote (dest)); usage (1); } } |