Thread (4 messages) flat view 4 messages, 3 authors, 2016-06-15

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

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:51:29

Ramsay Jones [off-list ref] writes:
-#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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help