[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#21573: (no subject)
From: |
YAMAMOTO Mitsuharu |
Subject: |
bug#21573: (no subject) |
Date: |
Sun, 06 Dec 2015 15:28:52 +0900 |
User-agent: |
Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.8 (Shijō) APEL/10.6 Emacs/22.3 (sparc-sun-solaris2.8) MULE/5.0 (SAKAKI) |
>>>>> On Thu, 03 Dec 2015 15:23:41 +0300, Alexander Zhukov <zuav@crystax.net>
>>>>> said:
> Yes, it's OS X specific. Even more, it's seems to be specific to my
> machine and the author of the original bug. I have reported this bug
> to magit initially and so far nobody with OS X machines was able to
> reproduce the bug.
I could reproduce it with the Mac port as well as the NS port on OS X
10.11. It seems that faccessat (AT_CWD, "pathToExecutable/.", F_OK,
AT_EACCESS) returns 0 after the call to -[NSWindow
setRepresentedFilename:@"pathToExecutable"], which sets the proxy icon
on the title bar. If you compile the source (faccessattest.m) at the
end of this mail with $ cc faccessattest.m -framework Cocoa, and run
it with $ ./a.out, then the output becomes
-1
0
rather than expected
-1
-1
I've just sent a bug report to Apple.
YAMAMOTO Mitsuharu
mituharu@math.s.chiba-u.ac.jp
#import <Cocoa/Cocoa.h>
int main (int argc, char *argv[])
{
char *name, *nameWithSlashDot;
name = argv[argc - 1];
nameWithSlashDot = alloca (strlen (name) + sizeof ("/."));
sprintf (nameWithSlashDot, "%s/.", name);
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSWindow *window = [[[NSWindow alloc] init] autorelease];
printf ("%d\n", faccessat (AT_FDCWD, nameWithSlashDot, F_OK, AT_EACCESS));
[window setRepresentedFilename:[NSString stringWithUTF8String:name]];
printf ("%d\n", faccessat (AT_FDCWD, nameWithSlashDot, F_OK, AT_EACCESS));
[pool release];
}