Put was assuming that the remote name was always absolute, and not relative to
the current remote directory.
Signed-off-by: Sam Liddicott <sam@liddicott.com>
lname = talloc_strdup(ctx, args[1]);
- if (args[2])
- rname = talloc_strdup(ctx, args[2]);
- else
+ if (args[2]) {
+ if (args[2][0]=='\\')
+ rname = talloc_strdup(ctx, args[2]);
+ else
+ rname = talloc_asprintf(ctx, "%s\\%s", ctx->remote_cur_dir, args[2]);
+ } else {
rname = talloc_asprintf(ctx, "%s\\%s", ctx->remote_cur_dir, lname);
+ }
dos_clean_name(rname);