all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Paul Eggert <eggert@cs.ucla.edu>
To: Philipp <p.stephani2@gmail.com>
Cc: 30350@debbugs.gnu.org, Sam Steingold <sds@podval.org>,
	Alan Third <alan@idiocy.org>
Subject: bug#30350: 27.0.50; Newest master can't run processes on macOS
Date: Mon, 5 Feb 2018 11:13:16 -0800	[thread overview]
Message-ID: <616d413a-893c-a058-9620-0ac852fc8490@cs.ucla.edu> (raw)
In-Reply-To: <m21si0a4ub.fsf@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 371 bytes --]

Does the attached patch work around the macOS bug? (I don't use macOS so 
can't easily test this.) The idea of this patch is to fix both the new 
bug with file-directory-p and the circa-2012 bug with 
file-accessible-directory-p.

The bug should probably be fixed in Gnulib so that Emacs proper is 
unaffected, but first I want to check whether this fix approach works.


[-- Attachment #2: fileio.diff --]
[-- Type: text/x-patch, Size: 1010 bytes --]

diff --git a/src/fileio.c b/src/fileio.c
index be29e60fc0..b0ef3d4e91 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -2811,12 +2811,15 @@ file_accessible_directory_p (Lisp_Object file)
     dir = data;
   else
     {
-      /* Just check for trailing '/' when deciding whether to append '/'.
-	 That's simpler than testing the two special cases "/" and "//",
-	 and it's a safe optimization here.  */
-      char *buf = SAFE_ALLOCA (len + 3);
+      /* Just check for trailing '/' when deciding whether append '/'
+	 before appending '.'.  That's simpler than testing the two
+	 special cases "/" and "//", and it's a safe optimization
+	 here.  After appending '.', append another '/' to work around
+	 a macOS bug (Bug#30350).  */
+      static char const appended[] = "/./";
+      char *buf = SAFE_ALLOCA (len + sizeof appended);
       memcpy (buf, data, len);
-      strcpy (buf + len, &"/."[data[len - 1] == '/']);
+      strcpy (buf + len, &appended[data[len - 1] == '/']);
       dir = buf;
     }
 

  parent reply	other threads:[~2018-02-05 19:13 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-04 20:15 bug#30350: 27.0.50; Newest master can't run processes on macOS Philipp
2018-02-04 20:20 ` Philipp Stephani
2018-02-04 21:06   ` Alan Third
2018-02-04 21:12     ` Alan Third
2018-02-04 21:28       ` Philipp Stephani
2018-02-04 22:49         ` Alan Third
2018-02-04 23:16           ` Philipp Stephani
2018-02-10 10:47     ` Eli Zaretskii
2018-02-04 20:24 ` Eli Zaretskii
2018-02-05 19:13 ` Paul Eggert [this message]
2018-02-05 19:18   ` Alan Third
2018-02-05 23:56     ` Paul Eggert
2018-02-06  0:26       ` Philipp Stephani
2018-02-06  0:36         ` Paul Eggert
2018-02-06  0:43           ` Philipp Stephani
2018-02-06 23:38             ` Paul Eggert
2018-02-06  8:28           ` Alan Third
2018-02-06 22:07         ` Philipp Stephani
2018-02-06 22:10           ` Philipp Stephani
2018-02-11 15:56             ` Philipp Stephani
2018-02-06 22:44           ` Alan Third
2018-02-06 22:53             ` Noam Postavsky
2018-02-11 16:01             ` Philipp Stephani
2018-02-11 21:15               ` Alan Third
2020-08-16 16:53                 ` Lars Ingebrigtsen
2020-10-02  4:54                   ` Lars Ingebrigtsen

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=616d413a-893c-a058-9620-0ac852fc8490@cs.ucla.edu \
    --to=eggert@cs.ucla.edu \
    --cc=30350@debbugs.gnu.org \
    --cc=alan@idiocy.org \
    --cc=p.stephani2@gmail.com \
    --cc=sds@podval.org \
    /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.