all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
To: Alexander Zhukov <zuav@crystax.net>
Cc: 21573@debbugs.gnu.org
Subject: bug#21573: (no subject)
Date: Sun, 06 Dec 2015 15:28:52 +0900	[thread overview]
Message-ID: <wl610c3xaz.wl%mituharu@math.s.chiba-u.ac.jp> (raw)
In-Reply-To: <m28u5bbu0i.fsf@crystax.net>

>>>>> 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];
}





  reply	other threads:[~2015-12-06  6:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-27  6:27 bug#21573: 24.5; file-accessible-directory-p behaves incorrectly with executable file on Mac OS X Praveen Kumar
2015-12-02 18:11 ` bug#21573: (no subject) Alexander Zhukov
2015-12-03  7:14   ` Eli Zaretskii
2015-12-03 12:23     ` Alexander Zhukov
2015-12-06  6:28       ` YAMAMOTO Mitsuharu [this message]
2021-01-03 10:44         ` bug#21573: 24.5; file-accessible-directory-p behaves incorrectly with executable file on Mac OS X Alan Third
2016-03-26 10:07 ` bug#21573: Jonas Bernoulli

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=wl610c3xaz.wl%mituharu@math.s.chiba-u.ac.jp \
    --to=mituharu@math.s.chiba-u.ac.jp \
    --cc=21573@debbugs.gnu.org \
    --cc=zuav@crystax.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.