ソースを参照

tool/afcclient: Fix local file name error on pulling folder from device

Signed-off-by: tomriddly <tomriddly@qq.com>
tomriddly 9 ヶ月 前
コミット
a6b6c35d15
1 ファイル変更1 行追加1 行削除
  1. 1 1
      tools/afcclient.c

+ 1 - 1
tools/afcclient.c

@@ -922,7 +922,7 @@ static void handle_get(afc_client_t afc, int argc, char **argv)
 
 	// target is a directory, put file under this target
 	if (is_directory(dstpath)) {
-		const char *basen = path_get_basename(argv[0]);
+		const char *basen = path_get_basename(srcpath);
 		uint8_t dst_is_root = strcmp(dstpath, "/") == 0;
 		size_t len = dst_is_root ? (strlen(basen) + 2) : (strlen(dstpath) + 1 + strlen(basen) + 1);
 		char *newdst = (char *) malloc(len);