about summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
authorBarton E. Schaefer <schaefer@zsh.org>2018-04-15 11:06:43 -0700
committerBarton E. Schaefer <schaefer@zsh.org>2018-04-15 11:06:43 -0700
commit68d9526220d77466a75928fc6a20008cf64e0590 (patch)
tree3bb7bea8a34565092dcab125da9371a4712da874 /Src
parent517cda383217ae4c68c5782429a5dbc4962b407a (diff)
downloadzsh-68d9526220d77466a75928fc6a20008cf64e0590.tar.gz
zsh-68d9526220d77466a75928fc6a20008cf64e0590.tar.xz
zsh-68d9526220d77466a75928fc6a20008cf64e0590.zip
42650: fix 42156 for zero-sized terminals
Also fix harmless no-op typo from hand-applying 42636 for previous commit.
Diffstat (limited to 'Src')
-rw-r--r--Src/utils.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/Src/utils.c b/Src/utils.c
index cb292a050..b41851700 100644
--- a/Src/utils.c
+++ b/Src/utils.c
@@ -1834,8 +1834,9 @@ adjustlines(int signalled)
     else
 	shttyinfo.winsize.ws_row = zterm_lines;
 #endif /* TIOCGWINSZ */
-    if (zterm_lines < 0) {
-	DPUTS(signalled, "BUG: Impossible TIOCGWINSZ rows");
+    if (zterm_lines <= 0) {
+	DPUTS(signalled && zterm_lines < 0,
+	      "BUG: Impossible TIOCGWINSZ rows");
 	zterm_lines = tclines > 0 ? tclines : 24;
     }
 
@@ -1858,8 +1859,9 @@ adjustcolumns(int signalled)
     else
 	shttyinfo.winsize.ws_col = zterm_columns;
 #endif /* TIOCGWINSZ */
-    if (zterm_columns < 0) {
-	DPUTS(signalled, "BUG: Impossible TIOCGWINSZ cols");
+    if (zterm_columns <= 0) {
+	DPUTS(signalled && zterm_columns < 0,
+	      "BUG: Impossible TIOCGWINSZ cols");
 	zterm_columns = tccolumns > 0 ? tccolumns : 80;
     }
 
@@ -2777,7 +2779,7 @@ checkrmall(char *s)
 	int ignoredots = !isset(GLOBDOTS);
 	char *fname;
 
-	while (fname = zreaddir(rmd, 1)) {
+	while ((fname = zreaddir(rmd, 1))) {
 	    if (ignoredots && *fname == '.')
 		continue;
 	    count++;