From 3f5c4e8dfe4d29d793251379c8f8fdcda2008088 Mon Sep 17 00:00:00 2001 From: Dees_Troy Date: Fri, 1 Feb 2013 15:16:59 +0000 Subject: Fix fail over to vfat from exfat Fix issues with MD5 checking using chdir and leaving the working dir in a subfolder that prevented unmounting sometimes. Change-Id: I01a563d722f474297ed3f7a30064c3a61748ade3 --- twrp-functions.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'twrp-functions.cpp') diff --git a/twrp-functions.cpp b/twrp-functions.cpp index 0c4471ac7..4a5dec273 100644 --- a/twrp-functions.cpp +++ b/twrp-functions.cpp @@ -62,8 +62,7 @@ int TWFunc::Check_MD5(string File) { if (Path_Exists(MD5_File)) { DirPath = Get_Path(File); MD5_File = Get_Filename(MD5_File); - chdir(DirPath.c_str()); - Command = "/sbin/busybox md5sum -c " + MD5_File; + Command = "cd '" + DirPath + "' && /sbin/busybox md5sum -c '" + MD5_File + "'"; Exec_Cmd(Command, result); pos = result.find(":"); if (pos != string::npos) { -- cgit v1.2.3