Module Name:    src
Committed By:   martin
Date:           Fri Mar  1 17:02:21 UTC 2019

Modified Files:
        src/usr.bin/msgc: msg_sys.def

Log Message:
msg_prompt_win: allow automatic window height calculation (by passing
height = -1).


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/usr.bin/msgc/msg_sys.def

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/msgc/msg_sys.def
diff -u src/usr.bin/msgc/msg_sys.def:1.43 src/usr.bin/msgc/msg_sys.def:1.44
--- src/usr.bin/msgc/msg_sys.def:1.43	Tue Jan 22 18:39:49 2019
+++ src/usr.bin/msgc/msg_sys.def	Fri Mar  1 17:02:21 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg_sys.def,v 1.43 2019/01/22 18:39:49 martin Exp $	*/
+/*	$NetBSD: msg_sys.def,v 1.44 2019/03/01 17:02:21 martin Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -490,6 +490,7 @@ msg_prompt_win(msg msg_no, int x, int y,
 	WINDOW *svmsg = NULL, *sv_win = NULL; /* XXX -Wuninitialized [many] */
 	int maxx, maxy;
 	int msg_flags = MSG_PROMPT_ECHO | MSG_PROMPT_HIDE_DFLT;
+	const char *np, *ep;
 
 	maxx = getmaxx(msg_win);
 	maxy = getmaxy(msg_win);
@@ -517,6 +518,12 @@ msg_prompt_win(msg msg_no, int x, int y,
 
 	if (x == -1)
 		x = (maxx - w) / 2 + 1;
+	if (h < 0) {
+		h = 3;
+		for (np = msg_string(msg_no); (ep = strchr(np, '\n'));
+		    np = ep + 1)
+			h++;
+	}
 	if (h < 3)
 		h = 3;
 	if (y < 3)

Reply via email to