diff options
| author | 2024-07-25 10:02:46 +0800 | |
|---|---|---|
| committer | 2025-02-28 13:22:09 +0100 | |
| commit | a6b6c35d1550acbd2552d49c2fe38115deec8fc0 (patch) | |
| tree | 4d1a6444806c835dbcc550bed32db2bfb414bd56 | |
| parent | 8dad5e214f1fa9d83b805517f3a6dcf355bf4662 (diff) | |
| download | libimobiledevice-a6b6c35d1550acbd2552d49c2fe38115deec8fc0.tar.gz libimobiledevice-a6b6c35d1550acbd2552d49c2fe38115deec8fc0.tar.bz2 | |
tool/afcclient: Fix local file name error on pulling folder from device
Signed-off-by: tomriddly <tomriddly@qq.com>
| -rw-r--r-- | tools/afcclient.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/afcclient.c b/tools/afcclient.c index 1546a6c..1cddb36 100644 --- a/tools/afcclient.c +++ b/tools/afcclient.c | |||
| @@ -922,7 +922,7 @@ static void handle_get(afc_client_t afc, int argc, char **argv) | |||
| 922 | 922 | ||
| 923 | // target is a directory, put file under this target | 923 | // target is a directory, put file under this target |
| 924 | if (is_directory(dstpath)) { | 924 | if (is_directory(dstpath)) { |
| 925 | const char *basen = path_get_basename(argv[0]); | 925 | const char *basen = path_get_basename(srcpath); |
| 926 | uint8_t dst_is_root = strcmp(dstpath, "/") == 0; | 926 | uint8_t dst_is_root = strcmp(dstpath, "/") == 0; |
| 927 | size_t len = dst_is_root ? (strlen(basen) + 2) : (strlen(dstpath) + 1 + strlen(basen) + 1); | 927 | size_t len = dst_is_root ? (strlen(basen) + 2) : (strlen(dstpath) + 1 + strlen(basen) + 1); |
| 928 | char *newdst = (char *) malloc(len); | 928 | char *newdst = (char *) malloc(len); |
