File: sun.ed

package info (click to toggle)
9term 1.6.6-5
  • links: PTS
  • area: main
  • in suites: hamm, slink
  • size: 2,340 kB
  • ctags: 2,035
  • sloc: ansic: 17,308; makefile: 220; sh: 178
file content (56 lines) | stat: -rw-r--r-- 1,017 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/bin/sh

echo "patching sam/unix.c"
ed sam/unix.c << EOF
/	p.*=.*realloc/c
	p = p ? realloc(p, n) : malloc(n);
.
w
q
EOF
echo "patching samterm/flayer.c"
ed samterm/flayer.c << EOF
/llist = realloc/c
			llist = llist ? realloc(llist, nlalloc*sizeof(Flayer**)) : malloc(nlalloc*sizeof(Flayer**));
.
w
q
EOF
echo "patching samterm/mesg.c"
ed samterm/mesg.c << EOF
/s1 = realloc/c
		s1 = s1 ? realloc(s1, n+1) : malloc(n+1);
.
w
q
EOF
echo "patching libframe/frbox.c"
ed libframe/frbox.c << EOF
/.*f->box.*=.*realloc/c
	f->box = f->box ? realloc(f->box, f->nalloc*sizeof(Frbox)) : malloc(f->nalloc*sizeof(Frbox));
.
w
q
EOF
echo "patching libframe/frinsert.c"
ed libframe/frinsert.c << EOF
/[	 ]*pts.*=.*realloc/c
			pts = pts ? realloc(pts, (npts+DELTA)*sizeof(pts[0])) : malloc((npts+DELTA)*sizeof(pts[0]));
.
w
q
EOF
for i in 9term/display.c libXg/gwin.c libXg/wrbitmap.c libXg/xtbinit.c
do
	echo "patching $i"
	ed $i << EOF
/^#include.*Intrinsic/i
#define	SYSV
.
/^#include.*Intrinsic/a
#undef SYSV
.
w
q
EOF
done