git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 1/3] help.c: Fix detection of custom merge strategy on cygwin

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 16, 2011, 22:24 UTC
Message-ID
<7v1uyth0t9.fsf@alter.siamese.dyndns.org>
In-Reply-To
<4DFA65F8.5010806@ramsay1.demon.co.uk>
Ramsay Jones <ramsay@ramsay1.demon.co.uk> writes:
Show 8 quoted lines
> -#ifdef WIN32
> +#if defined(WIN32) || defined(__CYGWIN__)
> +#if defined(__CYGWIN__)
> +if ((st.st_mode & S_IXUSR) == 0)
> +#endif
>  {	/* cannot trust the executable bit, peek into the file instead */
>  	char buf[3] = { 0 };
>  	int n;
This looks somewhat ugly.

I guess we could make the inner #if/#endif slightly more readable by letting the compiler do more work, like this:

	#if defined(WIN32) || defined(__CYGWIN__)
        if (!defined(__CYGWIN__) || !(st.st_mode & S_IXUSR)) {
        	...
	}
        #endif
I dunno.
Previous: Ramsay JonesNext: Ramsay Jones
Message 2 of 4 in “help.c: Fix detection of custom merge strategy on cygwin”
  1. 1/3 help.c: Fix detection of custom merge strategy on cygwinRamsay Jones, Jun 16, 2011
  2. Junio C HamanoJun 16, 2011
  3. Ramsay JonesJun 18, 2011
  4. Mark LevedahlJun 18, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.