20 lines
747 B
Diff
20 lines
747 B
Diff
diff -urN p7zip_9.20.1/CPP/myWindows/myAddExeFlag.cpp.orig p7zip_9.20.1/CPP/myWindows/myAddExeFlag.cpp
|
|
--- p7zip_9.20.1/CPP/myWindows/myAddExeFlag.cpp.orig 2009-07-14 07:01:50.000000000 -0400
|
|
+++ p7zip_9.20.1/CPP/myWindows/myAddExeFlag.cpp 2011-06-26 16:38:39.481000000 -0400
|
|
@@ -12,9 +12,14 @@
|
|
|
|
void myAddExeFlag(const UString &u_name)
|
|
{
|
|
+ struct stat fileinfo;
|
|
AString filename = UnicodeStringToMultiByte(u_name, CP_ACP); // FIXME
|
|
const char * name = nameWindowToUnix(filename);
|
|
// printf("myAddExeFlag(%s)\n",name);
|
|
- chmod(name,0700);
|
|
+
|
|
+ // should detect error, but this interface gives no capability to do so
|
|
+ stat(name, &fileinfo);
|
|
+ mode_t filemode = fileinfo.st_mode;
|
|
+ chmod(name, filemode | S_IXUSR | S_IXGRP | S_IXOTH);
|
|
}
|
|
|