+ goto bad;
+
+ if ((wwterm = getenv("TERM")) == 0)
+ goto bad;
+ if (tgetent(wwtermcap, wwterm) != 1)
+ goto bad;
+ wwbaud = wwbaudmap[wwoldtty.ww_sgttyb.sg_ospeed];
+
+ if (ttinit() < 0)
+ goto bad;
+ wwnrow = tt.tt_nrow;
+ wwncol = tt.tt_ncol;
+ (*tt.tt_reset)();
+ (*tt.tt_clreos)();
+
+ if ((wwsmap = wwalloc(wwnrow, wwncol, sizeof (char))) == 0)
+ goto bad;
+ for (i = 0; i < wwnrow; i++)
+ for (j = 0; j < wwncol; j++)
+ wwsmap[i][j] = WWX_NOBODY;
+ wwos = (union ww_char **)
+ wwalloc(wwnrow, wwncol, sizeof (union ww_char));
+ if (wwos == 0)
+ goto bad;
+ for (i = 0; i < wwnrow; i++)
+ for (j = 0; j < wwncol; j++)
+ wwos[i][j].c_w = ' ';
+ wwns = (union ww_char **)
+ wwalloc(wwnrow, wwncol, sizeof (union ww_char));
+ if (wwns == 0)
+ goto bad;
+ for (i = 0; i < wwnrow; i++)
+ for (j = 0; j < wwncol; j++)
+ wwns[i][j].c_w = ' ';
+
+ wwindex[WWX_NOBODY] = &wwnobody;
+ wwnobody.ww_order = NWW;