Fixed send_protected_args() to send "." in place of an empty arg.
authorWayne Davison <wayned@samba.org>
Sat, 11 Oct 2008 17:27:16 +0000 (10:27 -0700)
committerWayne Davison <wayned@samba.org>
Sat, 11 Oct 2008 17:27:16 +0000 (10:27 -0700)
rsync.c

diff --git a/rsync.c b/rsync.c
index 2d8e5e4..845517d 100644 (file)
--- a/rsync.c
+++ b/rsync.c
@@ -220,16 +220,19 @@ void send_protected_args(int fd, char *args[])
        if (DEBUG_GTE(CMD, 1))
                print_child_argv("protected args:", args + i + 1);
        do {
        if (DEBUG_GTE(CMD, 1))
                print_child_argv("protected args:", args + i + 1);
        do {
+               if (!args[i][0])
+                       write_buf(fd, ".", 2);
 #ifdef ICONV_OPTION
 #ifdef ICONV_OPTION
-               if (convert) {
+               else if (convert) {
                        INIT_XBUF_STRLEN(inbuf, args[i]);
                        iconvbufs(ic_send, &inbuf, &outbuf,
                                  ICB_EXPAND_OUT | ICB_INCLUDE_BAD | ICB_INCLUDE_INCOMPLETE);
                        outbuf.buf[outbuf.len] = '\0';
                        write_buf(fd, outbuf.buf, outbuf.len + 1);
                        outbuf.len = 0;
                        INIT_XBUF_STRLEN(inbuf, args[i]);
                        iconvbufs(ic_send, &inbuf, &outbuf,
                                  ICB_EXPAND_OUT | ICB_INCLUDE_BAD | ICB_INCLUDE_INCOMPLETE);
                        outbuf.buf[outbuf.len] = '\0';
                        write_buf(fd, outbuf.buf, outbuf.len + 1);
                        outbuf.len = 0;
-               } else
+               }
 #endif
 #endif
+               else
                        write_buf(fd, args[i], strlen(args[i]) + 1);
        } while (args[++i]);
        write_byte(fd, 0);
                        write_buf(fd, args[i], strlen(args[i]) + 1);
        } while (args[++i]);
        write_byte(fd, 0);