diff options
author | Junio C Hamano <gitster@pobox.com> | 2012-02-21 15:00:15 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2012-02-21 15:00:15 -0800 |
commit | c17ff2a36160ae51a1cefa9fe8f067dbeb33e884 (patch) | |
tree | 1599544b005ae2df04dcbca7c43b1ab1988e52c4 /help.c | |
parent | 1e2545c6878665f2092940eab1aaeb20703f7d14 (diff) | |
parent | ad6c3739a33586ba15a8c5c245dcd59e8a31cef1 (diff) | |
download | git-c17ff2a36160ae51a1cefa9fe8f067dbeb33e884.tar.gz git-c17ff2a36160ae51a1cefa9fe8f067dbeb33e884.tar.xz |
Merge branch 'zj/term-columns' into maint
* zj/term-columns:
pager: find out the terminal width before spawning the pager
Diffstat (limited to 'help.c')
-rw-r--r-- | help.c | 22 |
1 files changed, 0 insertions, 22 deletions
@@ -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); |