X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;ds=inline;f=help.c;h=14eefc91ced3890975d0833ffc83971c7986858b;hb=6eab5f2f14806cf6a7b665d96766a59c13a41f4b;hp=42193550f0b6f2a2c703c20c7abf1a81fe1b51d0;hpb=52b195f2b8e0d8c9d4583aab44846698ed3149f2;p=git.git diff --git a/help.c b/help.c index 42193550f..14eefc91c 100644 --- a/help.c +++ b/help.c @@ -5,28 +5,6 @@ #include "help.h" #include "common-cmds.h" -/* most GUI terminals set COLUMNS (although some don't export it) */ -static int term_columns(void) -{ - char *col_string = getenv("COLUMNS"); - int n_cols; - - if (col_string && (n_cols = atoi(col_string)) > 0) - return n_cols; - -#ifdef TIOCGWINSZ - { - struct winsize ws; - if (!ioctl(1, TIOCGWINSZ, &ws)) { - if (ws.ws_col) - return ws.ws_col; - } - } -#endif - - return 80; -} - void add_cmdname(struct cmdnames *cmds, const char *name, int len) { struct cmdname *ent = xmalloc(sizeof(*ent) + len + 1); @@ -127,7 +105,10 @@ static int is_executable(const char *name) !S_ISREG(st.st_mode)) return 0; -#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;