about summary refs log tree commit diff
path: root/Src/Modules
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2011-05-09 09:49:08 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2011-05-09 09:49:08 +0000
commitd89361739acdf07f0b0775c85f69abe89d57b600 (patch)
treeded652c4758d749b718d72491a95f9f2acdf427d /Src/Modules
parent70fd751a823ddc5fa9cfe696700edb5a4f2067bb (diff)
downloadzsh-d89361739acdf07f0b0775c85f69abe89d57b600.tar.gz
zsh-d89361739acdf07f0b0775c85f69abe89d57b600.tar.xz
zsh-d89361739acdf07f0b0775c85f69abe89d57b600.zip
29165: use term.h globally if needed at all.
Diffstat (limited to 'Src/Modules')
-rw-r--r--Src/Modules/files.c16
-rw-r--r--Src/Modules/termcap.c23
-rw-r--r--Src/Modules/zpty.c4
3 files changed, 10 insertions, 33 deletions
diff --git a/Src/Modules/files.c b/Src/Modules/files.c
index 3fbccf576..f86b9c1e9 100644
--- a/Src/Modules/files.c
+++ b/Src/Modules/files.c
@@ -195,7 +195,7 @@ bin_rmdir(char *nam, char **args, UNUSED(Options ops), UNUSED(int func))
 static int
 bin_ln(char *nam, char **args, Options ops, int func)
 {
-    MoveFunc move;
+    MoveFunc movefn;
     int flags, have_dir, err = 0;
     char **a, *ptr, *rp, *buf;
     struct stat st;
@@ -203,7 +203,7 @@ bin_ln(char *nam, char **args, Options ops, int func)
 
 
     if(func == BIN_MV) {
-	move = (MoveFunc) rename;
+	movefn = (MoveFunc) rename;
 	flags = OPT_ISSET(ops,'f') ? 0 : MV_ASKNW;
 	flags |= MV_ATOMIC;
     } else {
@@ -212,11 +212,11 @@ bin_ln(char *nam, char **args, Options ops, int func)
 	if(OPT_ISSET(ops,'h') || OPT_ISSET(ops,'n'))
 	    flags |= MV_NOCHASETARGET;
 	if(OPT_ISSET(ops,'s'))
-	    move = (MoveFunc) symlink;
+	    movefn = (MoveFunc) symlink;
 	else
 #endif
 	{
-	    move = (MoveFunc) link;
+	    movefn = (MoveFunc) link;
 	    if(!OPT_ISSET(ops,'d'))
 		flags |= MV_NODIRS;
 	}
@@ -267,7 +267,7 @@ bin_ln(char *nam, char **args, Options ops, int func)
 	else
 	    args[1] = args[0];
     }
-    return domove(nam, move, args[0], args[1], flags);
+    return domove(nam, movefn, args[0], args[1], flags);
  havedir:
     buf = ztrdup(*a);
     *a = NULL;
@@ -283,7 +283,7 @@ bin_ln(char *nam, char **args, Options ops, int func)
 
 	buf[blen] = 0;
 	buf = appstr(buf, ptr);
-	err |= domove(nam, move, *args, buf, flags);
+	err |= domove(nam, movefn, *args, buf, flags);
     }
     zsfree(buf);
     return err;
@@ -291,7 +291,7 @@ bin_ln(char *nam, char **args, Options ops, int func)
 
 /**/
 static int
-domove(char *nam, MoveFunc move, char *p, char *q, int flags)
+domove(char *nam, MoveFunc movefn, char *p, char *q, int flags)
 {
     struct stat st;
     char *pbuf, *qbuf;
@@ -341,7 +341,7 @@ domove(char *nam, MoveFunc move, char *p, char *q, int flags)
 	if(doit && !(flags & MV_ATOMIC))
 	    unlink(qbuf);
     }
-    if(move(pbuf, qbuf)) {
+    if(movefn(pbuf, qbuf)) {
 	zwarnnam(nam, "%s: %e", p, errno);
 	zsfree(pbuf);
 	return 1;
diff --git a/Src/Modules/termcap.c b/Src/Modules/termcap.c
index 7367dade7..cd0e85885 100644
--- a/Src/Modules/termcap.c
+++ b/Src/Modules/termcap.c
@@ -35,34 +35,11 @@
  */
 #include "../../config.h"
 
-#ifdef HAVE_TGETENT
-# if defined(ZSH_HAVE_CURSES_H) && defined(ZSH_HAVE_TERM_H)
-#  define USES_TERM_H 1
-# else
-#  ifdef HAVE_TERMCAP_H
-#   define USES_TERMCAP_H 1
-#  endif
-# endif
-#endif
-
 #include "termcap.mdh"
 #include "termcap.pro"
 
 /**/
 #ifdef HAVE_TGETENT
-# ifdef USES_TERM_H
-#  ifdef HAVE_TERMIO_H
-#   include <termio.h>
-#  endif
-#  ifdef ZSH_HAVE_CURSES_H
-#   include "../zshcurses.h"
-#  endif
-#  include "../zshterm.h"
-# else
-#  ifdef USES_TERMCAP_H
-#   include <termcap.h>
-#  endif
-# endif
 
 #ifndef HAVE_BOOLCODES
 static char *boolcodes[] = {
diff --git a/Src/Modules/zpty.c b/Src/Modules/zpty.c
index 2a81e68cb..25ec7dfea 100644
--- a/Src/Modules/zpty.c
+++ b/Src/Modules/zpty.c
@@ -351,8 +351,8 @@ newptycmd(char *nam, char *pname, char **args, int echo, int nblock)
 	    struct ttyinfo info;
 
 	    if (ioctl(slave, TIOCGWINSZ, (char *) &info.winsize) == 0) {
-		info.winsize.ws_row = lines;
-		info.winsize.ws_col = columns;
+		info.winsize.ws_row = zterm_lines;
+		info.winsize.ws_col = zterm_columns;
 		ioctl(slave, TIOCSWINSZ, (char *) &info.winsize);
 	    }
 	}