1
0
镜像自地址 https://github.com/arsenetar/dupeguru.git 已同步 2025-09-11 17:58:17 +00:00

Fixed crash under Cocoa when dupeGuru was launched from a path containing non-ascii characters.

这个提交包含在:
Virgil Dupras 2012-01-16 14:20:51 -05:00
父节点 9e668b11b8
当前提交 c53ddcdee1

查看文件

@ -9,10 +9,13 @@ http://www.hardcoded.net/licenses/bsd_license
#import <Cocoa/Cocoa.h> #import <Cocoa/Cocoa.h>
#import <Python.h> #import <Python.h>
#import <wchar.h> #import <wchar.h>
#import <locale.h>
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
/* We have to set the locate to UTF8 for mbstowcs() to correctly convert non-ascii chars in paths */
setlocale(LC_ALL, "en_US.UTF-8");
NSString *respath = [[NSBundle mainBundle] resourcePath]; NSString *respath = [[NSBundle mainBundle] resourcePath];
NSString *mainpy = [respath stringByAppendingPathComponent:@"dg_cocoa.py"]; NSString *mainpy = [respath stringByAppendingPathComponent:@"dg_cocoa.py"];
wchar_t wPythonPath[PATH_MAX+1]; wchar_t wPythonPath[PATH_MAX+1];