diff options
author | Richard Jones <rjones@redhat.com> | 2010-09-10 11:53:46 +0100 |
---|---|---|
committer | Richard Jones <rjones@redhat.com> | 2010-09-10 11:53:46 +0100 |
commit | b1e65806a185c6b2ec36efc04d85c268a65e97cc (patch) | |
tree | 666be2d3588e3185d646cda5adcda5b03a781397 | |
parent | f6246e932cb518cd8d7b3a02c338e736188f4115 (diff) | |
download | libguestfs-b1e65806a185c6b2ec36efc04d85c268a65e97cc.tar.gz libguestfs-b1e65806a185c6b2ec36efc04d85c268a65e97cc.tar.xz libguestfs-b1e65806a185c6b2ec36efc04d85c268a65e97cc.zip |
fish: const-correctness fixes in copy.c
-rw-r--r-- | fish/copy.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/fish/copy.c b/fish/copy.c index 944f4ccb..5a451a5b 100644 --- a/fish/copy.c +++ b/fish/copy.c @@ -31,7 +31,7 @@ static int make_tar_from_local (const char *local); static int make_tar_output (const char *local, const char *basename); -static int split_path (char *buf, size_t buf_size, const char *path, char **dirname, char **basename); +static int split_path (char *buf, size_t buf_size, const char *path, const char **dirname, const char **basename); int do_copy_in (const char *cmd, int argc, char *argv[]) @@ -119,7 +119,7 @@ make_tar_from_local (const char *local) close (fd[1]); char buf[PATH_MAX]; - char *dirname, *basename; + const char *dirname, *basename; if (split_path (buf, sizeof buf, local, &dirname, &basename) == -1) _exit (EXIT_FAILURE); @@ -132,7 +132,7 @@ make_tar_from_local (const char *local) */ static int split_path (char *buf, size_t buf_size, - const char *path, char **dirname, char **basename) + const char *path, const char **dirname, const char **basename) { size_t len = strlen (path); if (len == 0 || len > buf_size - 1) { @@ -154,7 +154,7 @@ split_path (char *buf, size_t buf_size, if (dirname) *dirname = buf; if (basename) *basename = p; } else if (p && p == buf) { /* "/foo" */ - if (dirname) *dirname = bad_cast ("/"); + if (dirname) *dirname = "/"; if (basename) *basename = buf+1; } else { if (dirname) *dirname = NULL; @@ -207,7 +207,7 @@ do_copy_out (const char *cmd, int argc, char *argv[]) return -1; if (r == 1) { /* is file */ char buf[PATH_MAX]; - char *basename; + const char *basename; if (split_path (buf, sizeof buf, argv[i], NULL, &basename) == -1) return -1; @@ -228,7 +228,7 @@ do_copy_out (const char *cmd, int argc, char *argv[]) } char buf[PATH_MAX]; - char *basename; + const char *basename; if (split_path (buf, sizeof buf, argv[i], NULL, &basename) == -1) return -1; |