this repo has no description
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix process name in NSLog()

+14
+14
src/libobjcdarwin/NSBundle_dyld.mm
··· 1 1 #import "NSBundle_dyld.h" 2 2 #import <limits.h> 3 3 #import <Foundation/NSString.h> 4 + #import <Foundation/NSProcessInfo.h> 5 + #import <Foundation/NSAutoreleasePool.h> 4 6 #include <string> 7 + #include <cstring> 5 8 #include <cstdio> 6 9 #include <algorithm> 7 10 #include "../util/log.h" ··· 16 19 LOG << "Swizzling methods in NSBundle\n"; 17 20 18 21 MethodSwizzle(objc_getMetaClass("NSBundle"), @selector(mainBundle), @selector(x_mainBundle)); 22 + 23 + const char* last = strrchr(g_darwin_executable_path, '/'); 24 + if (last != 0) 25 + { 26 + last++; 27 + 28 + NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init]; 29 + NSString* str = [NSString stringWithUTF8String:last]; 30 + [[NSProcessInfo processInfo] setProcessName:str]; 31 + [pool drain]; 32 + } 19 33 } 20 34 21 35