xref: /original-bsd/usr.bin/window/cmd3.c (revision c3e32dec)
1 /*
2  * Copyright (c) 1983, 1993
3  *	The Regents of the University of California.  All rights reserved.
4  *
5  * This code is derived from software contributed to Berkeley by
6  * Edward Wang at The University of California, Berkeley.
7  *
8  * %sccs.include.redist.c%
9  */
10 
11 #ifndef lint
12 static char sccsid[] = "@(#)cmd3.c	8.1 (Berkeley) 06/06/93";
13 #endif /* not lint */
14 
15 #include "defs.h"
16 #include "string.h"
17 
18 setescape(esc)
19 register char *esc;
20 {
21 	if (*esc == '^') {
22 		if (esc[1] != 0)
23 			escapec = esc[1] & 0x1f;
24 		else
25 			escapec = '^';
26 	} else
27 		escapec = *esc;
28 }
29 
30 setlabel(w, label)
31 register struct ww *w;
32 char *label;
33 {
34 	if (w->ww_label != 0)
35 		str_free(w->ww_label);
36 	if ((w->ww_label = str_cpy(label)) == 0)
37 		return -1;
38 	return 0;
39 }
40