openwin has new 'label' argument
[unix-history] / usr / src / usr.bin / window / cmd1.c
index a0c9041..f04a587 100644 (file)
@@ -1,5 +1,5 @@
 #ifndef lint
 #ifndef lint
-static char *sccsid = "@(#)cmd1.c      3.12 83/09/15";
+static char *sccsid = "@(#)cmd1.c      3.13 83/11/22";
 #endif
 
 #include "defs.h"
 #endif
 
 #include "defs.h"
@@ -65,7 +65,8 @@ c_window()
        if (!terse)
                (void) wwputs("\r\n", cmdwin);
        wwcurtowin(cmdwin);
        if (!terse)
                (void) wwputs("\r\n", cmdwin);
        wwcurtowin(cmdwin);
-       (void) openwin(id, row, col, xrow-row+1, xcol-col+1, nbufline);
+       (void) openwin(id, row, col, xrow-row+1, xcol-col+1, nbufline,
+               (char *) 0);
 }
 
 findid()
 }
 
 findid()
@@ -142,8 +143,9 @@ int maxrow, maxcol;
 }
 
 struct ww *
 }
 
 struct ww *
-openwin(id, row, col, nrow, ncol, nline)
+openwin(id, row, col, nrow, ncol, nline, label)
 int id, nrow, ncol, row, col;
 int id, nrow, ncol, row, col;
+char *label;
 {
        register struct ww *w;
 
 {
        register struct ww *w;
 
@@ -163,6 +165,8 @@ int id, nrow, ncol, row, col;
        w->ww_hasframe = 1;
        w->ww_altpos.r = 1;
        w->ww_altpos.c = 0;
        w->ww_hasframe = 1;
        w->ww_altpos.r = 1;
        w->ww_altpos.c = 0;
+       if (label != 0 && setlabel(w, label) < 0)
+               error("No memory for label.");
        wwcursor(w, 1);
        wwadd(w, framewin);
        selwin = w;
        wwcursor(w, 1);
        wwadd(w, framewin);
        selwin = w;