这是indexloc提供的服务,不要输入任何密码
Skip to content

Commit 24fbea7

Browse files
Fixed: Fix typo in CameraPhotoAPI and StorageGetAPI that was getting basename instead of dirname of file paths for parent dir
Created in cc186d0 and 950f9be
1 parent ba2836b commit 24fbea7

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

app/src/main/java/com/termux/api/apis/CameraPhotoAPI.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,10 @@ public static void onReceive(TermuxApiReceiver apiReceiver, final Context contex
5454
return;
5555
}
5656

57-
// Get canonical path of filePath
57+
// Get canonical path of photoFilePath
5858
String photoFilePath = TermuxFileUtils.getCanonicalPath(filePath, null, true);
59-
String photoDirPath = FileUtils.getFileBasename(photoFilePath);
59+
String photoDirPath = FileUtils.getFileDirname(photoFilePath);
60+
Logger.logVerbose(LOG_TAG, "photoFilePath=\"" + photoFilePath + "\", photoDirPath=\"" + photoDirPath + "\"");
6061

6162
// If workingDirectory is not a directory, or is not readable or writable, then just return
6263
// Creation of missing directory and setting of read, write and execute permissions are only done if workingDirectory is

app/src/main/java/com/termux/api/apis/StorageGetAPI.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ public static void onReceive(TermuxApiReceiver apiReceiver, final Context contex
4141

4242
// Get canonical path of fileExtra
4343
String filePath = TermuxFileUtils.getCanonicalPath(fileExtra, null, true);
44-
String fileParentDirPath = FileUtils.getFileBasename(filePath);
44+
String fileParentDirPath = FileUtils.getFileDirname(filePath);
45+
Logger.logVerbose(LOG_TAG, "filePath=\"" + filePath + "\", fileParentDirPath=\"" + fileParentDirPath + "\"");
4546

4647
Error error = FileUtils.checkMissingFilePermissions("file parent directory", fileParentDirPath, "rw-", true);
4748
if (error != null) {

0 commit comments

Comments
 (0)