git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Fix "git help -a" terminal autosizing
@ 2006-04-27 16:02 Linus Torvalds
  0 siblings, 0 replies; only message in thread
From: Linus Torvalds @ 2006-04-27 16:02 UTC (permalink / raw)
  To: Junio C Hamano, Git Mailing List


When I split out the builtin commands into their own files, I left the 
include of <sys/ioctl.h> in git.c rather than moving it to the file that 
needed it (builtin-help.c).

Nobody seems to have noticed, because everything still worked, but because 
the TIOCGWINSZ macro was now no longer defined when compiling the 
"term_columns()" function, it would no longer automatically notice the 
terminal size unless your system used the ancient "COLUMNS" environment 
variable approach.

Trivially fixed by just moving the header include to the file that 
actually needs it.

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
---
diff --git a/builtin-help.c b/builtin-help.c
index 10a59cc..7470faa 100644
--- a/builtin-help.c
+++ b/builtin-help.c
@@ -3,6 +3,7 @@
  *
  * Builtin help-related commands (help, usage, version)
  */
+#include <sys/ioctl.h>
 #include "cache.h"
 #include "builtin.h"
 #include "exec_cmd.h"
diff --git a/git.c b/git.c
index aa2b814..01b7e28 100644
--- a/git.c
+++ b/git.c
@@ -8,7 +8,6 @@ #include <string.h>
 #include <errno.h>
 #include <limits.h>
 #include <stdarg.h>
-#include <sys/ioctl.h>
 #include "git-compat-util.h"
 #include "exec_cmd.h"
 

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2006-04-27 16:03 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-04-27 16:02 Fix "git help -a" terminal autosizing Linus Torvalds

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).