Changeset 353


Ignore:
Timestamp:
Sep 19, 2011, 11:00:00 PM (14 years ago)
Author:
Yuri Dario
Message:

git: os2 patches by sava (t.ebisawa) from git 1.6.x.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified git/trunk/help.c

    r347 r353  
    128128                return 0;
    129129
    130 #ifdef WIN32
     130#if defined(__MINGW32__) || defined(__KLIBC__)
    131131{       /* cannot trust the executable bit, peek into the file instead */
    132132        char buf[3] = { 0 };
    133133        int n;
    134         int fd = open(name, O_RDONLY);
     134        int fd = open(name, O_RDONLY | O_BINARY);
    135135        st.st_mode &= ~S_IXUSR;
    136136        if (fd >= 0) {
     
    138138                if (n == 2)
    139139                        /* DOS executables start with "MZ" */
     140#if defined(__KLIBC__)
     141                        if (!strcmp(buf, "#!") || !strcmp(buf, "MZ") || !strcmp(buf, "LX"))
     142#else
    140143                        if (!strcmp(buf, "#!") || !strcmp(buf, "MZ"))
     144#endif
    141145                                st.st_mode |= S_IXUSR;
    142146                close(fd);
Note: See TracChangeset for help on using the changeset viewer.