diff --git a/cmdline/cmdline_afp.c b/cmdline/cmdline_afp.c index a9d64db..18f31cd 100644 --- a/cmdline/cmdline_afp.c +++ b/cmdline/cmdline_afp.c @@ -36,53 +36,56 @@ static int recursive_get(char * path); static int escape_paths(char * outgoing1, char * outgoing2, char * incoming) { - char * writeto=outgoing1; - int inquote=0, inescape=0, donewith1=0; + char * writeto = outgoing1; + int inquote = 0, inescape = 0, donewith1 = 0; char *p = incoming; if ((outgoing1==NULL) || (strlen(incoming)==0)) { goto error; } - memset(outgoing1,0,AFP_MAX_PATH); - if (outgoing2) memset(outgoing2,0,AFP_MAX_PATH); + memset(outgoing1, 0, AFP_MAX_PATH); + if (outgoing2) memset(outgoing2, 0, AFP_MAX_PATH); - for (p=incoming;p \n"); goto error; } + printf("from %s to %s\n", from_path, to_path); get_server_path(from_path,full_from_path); get_server_path(to_path,full_to_path); - printf("Moving from %s to %s\n",full_from_path,full_to_path); + printf("Moving from \"%s\" to \"%s\"\n",full_from_path,full_to_path); /* Make sure from_file exists */ if ((ret=ml_getattr(vol,full_from_path,&stbuf))) { - printf("Could not find file %s, error was %d\n", + printf("Could not find file \"%s\", error was %d\n", full_from_path,ret); goto error; } @@ -724,7 +728,7 @@ int com_rename (char * arg) /* Make sure to_file doesn't exist */ ret=ml_getattr(vol,full_to_path,&stbuf); if ((ret==0) && ((stbuf.st_mode & S_IFDIR)==0)) { - printf("File %s already exists, error: %d\n", + printf("File \"%s\" already exists, error: %d\n", full_to_path,ret); goto error; } @@ -756,11 +760,11 @@ int com_delete (char *arg) get_server_path(filename,server_fullname); if ((ret=ml_unlink(vol,server_fullname))) { - printf("Could not remove %s, error code is %d\n", + printf("Could not remove file \"%s\", error code is %d\n", filename,ret); goto error; } - printf("Removed file %s\n",filename); + printf("Removed file \"%s\"\n",filename); return (1); error: return -1; @@ -786,11 +790,11 @@ int com_mkdir(char *arg) get_server_path(filename,server_fullname); if ((ret=ml_mkdir(vol,server_fullname,0755))) { - printf("Could not create directory %s, error code is %d\n", + printf("Could not create directory \"%s\", error code is %d\n", filename,ret); goto error; } - printf("Created directory %s\n",filename); + printf("Created directory \"%s\"\n",filename); return 0; error: return -1; @@ -816,11 +820,11 @@ int com_rmdir(char *arg) get_server_path(filename,server_fullname); if ((ret=ml_rmdir(vol,server_fullname))) { - printf("Could not remove directory %s, error code is %d\n", + printf("Could not remove directory \"%s\", error code is %d\n", filename,ret); goto error; } - printf("Removed directory %s\n",filename); + printf("Removed directory \"%s\"\n",filename); return 0; error: return -1;