Fix build with clang by using more void and proper return values.diff -r1.14 -r1.15 pkgsrc/chat/icb/distinfo
(joerg)
@@ -1,54 +1,61 @@ | @@ -1,54 +1,61 @@ | |||
1 | $NetBSD: distinfo,v 1.14 2012/02/16 14:13:15 hans Exp $ | 1 | $NetBSD: distinfo,v 1.15 2013/01/11 13:24:32 joerg Exp $ | |
2 | 2 | |||
3 | SHA1 (icb-5.0.9.tar.gz) = 151430ad7fe3e9787627b31f6551bf1f398b1bd8 | 3 | SHA1 (icb-5.0.9.tar.gz) = 151430ad7fe3e9787627b31f6551bf1f398b1bd8 | |
4 | RMD160 (icb-5.0.9.tar.gz) = 8184620d7abf71fa38315fa14aa5345b6981c9bf | 4 | RMD160 (icb-5.0.9.tar.gz) = 8184620d7abf71fa38315fa14aa5345b6981c9bf | |
5 | Size (icb-5.0.9.tar.gz) = 357565 bytes | 5 | Size (icb-5.0.9.tar.gz) = 357565 bytes | |
6 | SHA1 (patch-aa) = b82fb642c79a200aaa47b0db397c82f19fb7f9ff | 6 | SHA1 (patch-aa) = b82fb642c79a200aaa47b0db397c82f19fb7f9ff | |
7 | SHA1 (patch-ab) = 636e02532dc3f3f5049e9806e102de580d136177 | 7 | SHA1 (patch-ab) = 636e02532dc3f3f5049e9806e102de580d136177 | |
8 | SHA1 (patch-ac) = 9748f2edb74e208034873eff117bdff8b30a06ca | 8 | SHA1 (patch-ac) = 99631dd1c526d5a07339205bad031003f6920495 | |
9 | SHA1 (patch-ad) = b64e9ca73b5e56122cb82363ee9c765457bde5ca | 9 | SHA1 (patch-ad) = b64e9ca73b5e56122cb82363ee9c765457bde5ca | |
10 | SHA1 (patch-ae) = c98d058cfe6177fb4807104695f96c774b11d177 | 10 | SHA1 (patch-ae) = c98d058cfe6177fb4807104695f96c774b11d177 | |
11 | SHA1 (patch-af) = b16cdbbd6d4a5489b19bb3339b6cd8d95b5395d9 | 11 | SHA1 (patch-af) = b16cdbbd6d4a5489b19bb3339b6cd8d95b5395d9 | |
12 | SHA1 (patch-ag) = d9d1a36a381829b4a5593d666185f79722a33697 | 12 | SHA1 (patch-ag) = d9d1a36a381829b4a5593d666185f79722a33697 | |
13 | SHA1 (patch-ah) = 464f3a3de74f049187d8e6702c6e060b4fe03146 | 13 | SHA1 (patch-ah) = f19c304314ee787cdf0a0123fbcfe869f6ded062 | |
14 | SHA1 (patch-ai) = 11322bc2753dd6921272b2e64554349bb7aa6c5c | 14 | SHA1 (patch-ai) = 11322bc2753dd6921272b2e64554349bb7aa6c5c | |
15 | SHA1 (patch-aj) = 1ba8c916513b449bede0330026b9f844d03d9a2f | 15 | SHA1 (patch-aj) = ba804422123bbc61a2ff2edf7429cd06678bb189 | |
16 | SHA1 (patch-ak) = 8e363cc6c5647c064d56ec75b8b627d7d9a07a72 | 16 | SHA1 (patch-ak) = 8e363cc6c5647c064d56ec75b8b627d7d9a07a72 | |
17 | SHA1 (patch-al) = 2133e12939f26a875b6f3e74221767adf6451c58 | 17 | SHA1 (patch-al) = a47617dd948fa972d0bab604514e4a47af117c55 | |
18 | SHA1 (patch-am) = 58ce219463d2cdb0306a664b383015096938e6d6 | 18 | SHA1 (patch-am) = b389f93a4cdb105e5dbbc5e97f642c7fff328f0d | |
19 | SHA1 (patch-an) = d66e16511fbfe4f51ba2f7f77a4a67087470342a | 19 | SHA1 (patch-an) = 4213261b8bb5638a789371ba1eb12923453741a5 | |
20 | SHA1 (patch-ao) = a798b898e3527f7a4458c6e278e86ef69bb38a53 | 20 | SHA1 (patch-ao) = a798b898e3527f7a4458c6e278e86ef69bb38a53 | |
21 | SHA1 (patch-ap) = 794d608ac548bc1b5c83b7bf967ed43e5cee65be | 21 | SHA1 (patch-ap) = 794d608ac548bc1b5c83b7bf967ed43e5cee65be | |
22 | SHA1 (patch-aq) = 78b772a2f6ec27a782b1681a61a2329992dcc741 | 22 | SHA1 (patch-aq) = 78b772a2f6ec27a782b1681a61a2329992dcc741 | |
23 | SHA1 (patch-ar) = 7fa954914f8c0fdad4f610f37dd81129ec57bc14 | 23 | SHA1 (patch-ar) = 739e982d907a5063ebd75ed080ffa5e32f9ef58a | |
24 | SHA1 (patch-as) = 5c42bfdc2e836fb86e814c396760040560864256 | 24 | SHA1 (patch-as) = 5c42bfdc2e836fb86e814c396760040560864256 | |
25 | SHA1 (patch-at) = 703abcc2415b92776241011fe893286de06da034 | 25 | SHA1 (patch-at) = 703abcc2415b92776241011fe893286de06da034 | |
26 | SHA1 (patch-au) = 2052ef3b8c28150700e0ba287162b0c62d53a90f | 26 | SHA1 (patch-au) = c67a2640e96d9670e0e0f8d0381fb1ad139e15a4 | |
27 | SHA1 (patch-av) = 2bef35b6868697c8b95a923e5ccf8ff900175b25 | 27 | SHA1 (patch-av) = 65e914e11087953cdd9a9b681152ca108ba64323 | |
28 | SHA1 (patch-aw) = 6dbc66a63f52244ac9b8b29346cb376b98442695 | 28 | SHA1 (patch-aw) = 6dbc66a63f52244ac9b8b29346cb376b98442695 | |
29 | SHA1 (patch-ax) = 6dc671de0abe01139fdaa193bd1c627b2d74cfb9 | 29 | SHA1 (patch-ax) = 6dc671de0abe01139fdaa193bd1c627b2d74cfb9 | |
30 | SHA1 (patch-ay) = f8a787d5a6611890d65fa8b0411977fd5c0bc7e9 | 30 | SHA1 (patch-ay) = f8a787d5a6611890d65fa8b0411977fd5c0bc7e9 | |
31 | SHA1 (patch-az) = 6d8a12c0309678e854253d1256b86851f9ed2b4e | 31 | SHA1 (patch-az) = 6d8a12c0309678e854253d1256b86851f9ed2b4e | |
32 | SHA1 (patch-ba) = b85f00aea832da4d9f730b5295f943264550a7ab | 32 | SHA1 (patch-ba) = b85f00aea832da4d9f730b5295f943264550a7ab | |
33 | SHA1 (patch-bb) = 64cebf4a262c31850bc1658e3a3c8841baadc37c | 33 | SHA1 (patch-bb) = 64cebf4a262c31850bc1658e3a3c8841baadc37c | |
34 | SHA1 (patch-bc) = 4a8273e45463a1b0f3373c26710ea47f76d96eab | 34 | SHA1 (patch-bc) = 4a8273e45463a1b0f3373c26710ea47f76d96eab | |
35 | SHA1 (patch-bd) = f4ed0e007c5971d8c01e1c1cfebfd32adb24a746 | 35 | SHA1 (patch-bd) = f4ed0e007c5971d8c01e1c1cfebfd32adb24a746 | |
36 | SHA1 (patch-be) = 862df6c2de3a26c8a8b761b122ddea73fdf8d910 | 36 | SHA1 (patch-be) = 862df6c2de3a26c8a8b761b122ddea73fdf8d910 | |
37 | SHA1 (patch-bf) = 4e65811b06f100659c83a3c6a95fa0ba5732f991 | 37 | SHA1 (patch-bf) = 4e65811b06f100659c83a3c6a95fa0ba5732f991 | |
38 | SHA1 (patch-bg) = 30c13a23de9e1e232e69011755e788d9a1df1f20 | 38 | SHA1 (patch-bg) = 30c13a23de9e1e232e69011755e788d9a1df1f20 | |
39 | SHA1 (patch-bh) = 5e24c606b9ee9656b15d66a4611d732b563cc831 | 39 | SHA1 (patch-bh) = 5e24c606b9ee9656b15d66a4611d732b563cc831 | |
40 | SHA1 (patch-bi) = cc92516799335123f6ac0d37380a428e9a88063d | 40 | SHA1 (patch-bi) = cc92516799335123f6ac0d37380a428e9a88063d | |
41 | SHA1 (patch-bj) = 082e74059e3c2f91f5a56b5d100e4cdedd00340f | 41 | SHA1 (patch-bj) = af62a5bef6a3bac7cdd22e3aca7f1eeb50b15b29 | |
42 | SHA1 (patch-bk) = caab3a28f9e05f7e3321d5b56ad3dd47ee3e3b40 | 42 | SHA1 (patch-bk) = caab3a28f9e05f7e3321d5b56ad3dd47ee3e3b40 | |
43 | SHA1 (patch-bl) = cef6d92a02bb6080a9121f2ecbd36c4b15777a68 | 43 | SHA1 (patch-bl) = cef6d92a02bb6080a9121f2ecbd36c4b15777a68 | |
44 | SHA1 (patch-bm) = 1171ce0885693b198d8d7ad8960c55dec4604aa0 | 44 | SHA1 (patch-bm) = 1171ce0885693b198d8d7ad8960c55dec4604aa0 | |
45 | SHA1 (patch-bn) = 57972d7c9712755833dc97559edded528e38aa97 | 45 | SHA1 (patch-bn) = 57972d7c9712755833dc97559edded528e38aa97 | |
46 | SHA1 (patch-bo) = 03f940e1ebfcfa4c33e84852d9d4852f8c9da92a | 46 | SHA1 (patch-bo) = 03f940e1ebfcfa4c33e84852d9d4852f8c9da92a | |
47 | SHA1 (patch-bp) = f79cfc4a9bd18397611e3dd46b4b85675054da6c | 47 | SHA1 (patch-bp) = f79cfc4a9bd18397611e3dd46b4b85675054da6c | |
48 | SHA1 (patch-bq) = bdb076f4aaed118baa893297aa98f10e9aa6cb28 | 48 | SHA1 (patch-bq) = df24d4eae25858bb5d0aa054f3d0bf2fd834714a | |
49 | SHA1 (patch-br) = f0cc8e6fb3e83076a0160b455e64cfe82f297f44 | 49 | SHA1 (patch-br) = b0670b6ad7e91d5502598f25f66fc7b5d0b5afb8 | |
50 | SHA1 (patch-bs) = c0b5a045b02e9630d2dda713b5d54b780ed2d5de | 50 | SHA1 (patch-bs) = c0b5a045b02e9630d2dda713b5d54b780ed2d5de | |
51 | SHA1 (patch-bt) = a5eb739d19170e2af57cafc81e8adaf5e27b85a8 | 51 | SHA1 (patch-bt) = 1e16a2fd21f65fb1da680e2ea2e1efd891c40b27 | |
52 | SHA1 (patch-icb_c__hush.c) = cdfe910a11d3ceace118d01edc4eb0d2f05c4058 | |||
53 | SHA1 (patch-icb_c__replay.c) = a1c6b9245202819e5ed79ec99df14abbc010fed0 | |||
54 | SHA1 (patch-icb_msgs.c) = 06619b7a260d8f761109f1b54fffa674b71c34d9 | |||
55 | SHA1 (patch-icb_parse.c) = 5ed95b8cbd409323683fdc6364b934e8ccaa7a23 | |||
52 | SHA1 (patch-icb_signals.c) = 1b648d7137ad361e43d4cd472fe811d16ec5cac7 | 56 | SHA1 (patch-icb_signals.c) = 1b648d7137ad361e43d4cd472fe811d16ec5cac7 | |
53 | SHA1 (patch-murgil_contoport.c) = 2ee05addd21be0d906b5147efac1f48841d72298 | 57 | SHA1 (patch-murgil_contoport.c) = 2ee05addd21be0d906b5147efac1f48841d72298 | |
54 | SHA1 (patch-murgil_makeport.c) = cacfa30605bcc688a8a48f6152527de82d04a9c8 | 58 | SHA1 (patch-murgil_makeport.c) = cacfa30605bcc688a8a48f6152527de82d04a9c8 | |
59 | SHA1 (patch-readline_funmap.c) = 262d16194937918928963d1809f683f91419eff0 | |||
60 | SHA1 (patch-readline_keymaps.c) = 3f9534f18bbfbbdb11d66ca9db390524af252ac0 | |||
61 | SHA1 (patch-readline_vi__mode.c) = 48ed2f4a0070491014e940bcc9a6edffa986cb2a |
@@ -1,17 +1,17 @@ | @@ -1,17 +1,17 @@ | |||
1 | $NetBSD: patch-ac,v 1.3 2012/02/16 14:13:15 hans Exp $ | 1 | $NetBSD: patch-ac,v 1.4 2013/01/11 13:24:32 joerg Exp $ | |
2 | 2 | |||
3 | --- icb/c_log.c.orig 1995-02-24 16:20:18.000000000 -0500 | 3 | --- icb/c_log.c.orig 1995-02-24 21:20:18.000000000 +0000 | |
4 | +++ icb/c_log.c 2008-12-16 20:17:59.000000000 -0500 | 4 | +++ icb/c_log.c | |
5 | @@ -6,6 +6,7 @@ | 5 | @@ -6,6 +6,7 @@ | |
6 | #include "icb.h" | 6 | #include "icb.h" | |
7 | #include "externs.h" | 7 | #include "externs.h" | |
8 | #include <time.h> | 8 | #include <time.h> | |
9 | +#include <errno.h> | 9 | +#include <errno.h> | |
10 | 10 | |||
11 | FILE *logfp = NULL; | 11 | FILE *logfp = NULL; | |
12 | 12 | |||
13 | @@ -45,8 +46,6 @@ char *path; | 13 | @@ -45,8 +46,6 @@ char *path; | |
14 | time_t time(); | 14 | time_t time(); | |
15 | struct tm *t, *localtime(); | 15 | struct tm *t, *localtime(); | |
16 | time_t clock; | 16 | time_t clock; | |
17 | - extern int errno, sys_nerr; | 17 | - extern int errno, sys_nerr; | |
@@ -48,24 +48,33 @@ $NetBSD: patch-ac,v 1.3 2012/02/16 14:13 | @@ -48,24 +48,33 @@ $NetBSD: patch-ac,v 1.3 2012/02/16 14:13 | |||
48 | logfp = NULL; | 48 | logfp = NULL; | |
49 | return(-1); | 49 | return(-1); | |
50 | @@ -97,8 +88,8 @@ char *path; | 50 | @@ -97,8 +88,8 @@ char *path; | |
51 | aptr++; | 51 | aptr++; | |
52 | 52 | |||
53 | /* timestamp it */ | 53 | /* timestamp it */ | |
54 | - sprintf(mbuf, "Session log \"%s\" started at %d/%02d/%-2d %s.", | 54 | - sprintf(mbuf, "Session log \"%s\" started at %d/%02d/%-2d %s.", | |
55 | - path, t->tm_mon+1, t->tm_mday, t->tm_year, aptr); | 55 | - path, t->tm_mon+1, t->tm_mday, t->tm_year, aptr); | |
56 | + sprintf(mbuf, "Session log \"%s\" started at %d/%02d/%-4d %s.", | 56 | + sprintf(mbuf, "Session log \"%s\" started at %d/%02d/%-4d %s.", | |
57 | + path, t->tm_mon+1, t->tm_mday, 1900+t->tm_year, aptr); | 57 | + path, t->tm_mon+1, t->tm_mday, 1900+t->tm_year, aptr); | |
58 | putl(mbuf, PL_SCR | PL_LOG); | 58 | putl(mbuf, PL_SCR | PL_LOG); | |
59 | 59 | |||
60 | return(0); | 60 | return(0); | |
61 | @@ -107,7 +98,7 @@ char *path; | |||
62 | ||||
63 | /* close the logfile */ | |||
64 | ||||
65 | -closesessionlog() | |||
66 | +void closesessionlog(void) | |||
67 | { | |||
68 | char *aptr, *ampm(); | |||
69 | time_t time(); | |||
61 | @@ -126,8 +117,8 @@ closesessionlog() | 70 | @@ -126,8 +117,8 @@ closesessionlog() | |
62 | aptr++; | 71 | aptr++; | |
63 | 72 | |||
64 | /* timestamp it */ | 73 | /* timestamp it */ | |
65 | - sprintf(mbuf, "Session log closed at %d/%02d/%-2d %s.", | 74 | - sprintf(mbuf, "Session log closed at %d/%02d/%-2d %s.", | |
66 | - t->tm_mon+1, t->tm_mday, t->tm_year, aptr); | 75 | - t->tm_mon+1, t->tm_mday, t->tm_year, aptr); | |
67 | + sprintf(mbuf, "Session log closed at %d/%02d/%-4d %s.", | 76 | + sprintf(mbuf, "Session log closed at %d/%02d/%-4d %s.", | |
68 | + t->tm_mon+1, t->tm_mday, 1900+t->tm_year, aptr); | 77 | + t->tm_mon+1, t->tm_mday, 1900+t->tm_year, aptr); | |
69 | putl(mbuf, PL_SCR | PL_LOG); | 78 | putl(mbuf, PL_SCR | PL_LOG); | |
70 | 79 | |||
71 | /* close it */ | 80 | /* close it */ |
@@ -1,12 +1,16 @@ | @@ -1,12 +1,16 @@ | |||
1 | $NetBSD: patch-ah,v 1.3 2008/12/17 02:19:59 christos Exp $ | 1 | $NetBSD: patch-ah,v 1.4 2013/01/11 13:24:32 joerg Exp $ | |
2 | 2 | |||
3 | --- icb/history.c.orig 1995-02-24 16:20:23.000000000 -0500 | 3 | --- icb/history.c.orig 1995-02-24 21:20:23.000000000 +0000 | |
4 | +++ icb/history.c 2008-12-16 20:18:00.000000000 -0500 | 4 | +++ icb/history.c | |
5 | @@ -19,7 +19,6 @@ | 5 | @@ -16,10 +16,8 @@ static STRLIST *hp = (STRLIST *) 0; /* u | |
6 | histput(nick) | 6 | /* add a username to the list */ | |
7 | char *nick; | 7 | /* called whenever a user sends a personal message to another */ | |
8 | ||||
9 | -histput(nick) | |||
10 | -char *nick; | |||
11 | +void histput(char *nick) | |||
8 | { | 12 | { | |
9 | - char *malloc(); | 13 | - char *malloc(); | |
10 | STRLIST *sp; | 14 | STRLIST *sp; | |
11 | 15 | |||
12 | /* hunt for user within list */ | 16 | /* hunt for user within list */ |
@@ -1,21 +1,39 @@ | @@ -1,21 +1,39 @@ | |||
1 | $NetBSD: patch-aj,v 1.3 2008/12/17 02:19:59 christos Exp $ | 1 | $NetBSD: patch-aj,v 1.4 2013/01/11 13:24:32 joerg Exp $ | |
2 | 2 | |||
3 | --- icb/oset.c.orig 1995-02-24 16:20:24.000000000 -0500 | 3 | --- icb/oset.c.orig 1995-02-24 21:20:24.000000000 +0000 | |
4 | +++ icb/oset.c 2008-12-16 20:18:00.000000000 -0500 | 4 | +++ icb/oset.c | |
5 | @@ -39,6 +39,7 @@ | 5 | @@ -39,6 +39,7 @@ VARIABLE vars[] = { | |
6 | { "pagesize", V_INT, (char *)&gv.pagesize }, | 6 | { "pagesize", V_INT, (char *)&gv.pagesize }, | |
7 | { "pauseonshell", V_BOOLEAN, (char *)&gv.pauseonshell }, | 7 | { "pauseonshell", V_BOOLEAN, (char *)&gv.pauseonshell }, | |
8 | { "personalto", V_STRING, (char *)&gv.personalto }, | 8 | { "personalto", V_STRING, (char *)&gv.personalto }, | |
9 | + { "printtime", V_BOOLEAN, (char *)&gv.printtime }, | 9 | + { "printtime", V_BOOLEAN, (char *)&gv.printtime }, | |
10 | { "restricted", V_BOOLEAN, (char *)&gv.restricted }, | 10 | { "restricted", V_BOOLEAN, (char *)&gv.restricted }, | |
11 | { "tabreply", V_BOOLEAN, (char *)&gv.tabreply }, | 11 | { "tabreply", V_BOOLEAN, (char *)&gv.tabreply }, | |
12 | { "timedisplay", V_STRING, (char *)&gv.timedisplay }, | 12 | { "timedisplay", V_STRING, (char *)&gv.timedisplay }, | |
13 | @@ -140,7 +141,7 @@ | 13 | @@ -70,7 +71,7 @@ TARGDEFS | |
14 | if (gv.restricted) | |||
15 | TRETURNERR("oset: restricted mode can't be reset") | |||
16 | else { | |||
17 | - restrict(); | |||
18 | + restricted(); | |||
19 | return(TCL_OK); | |||
20 | } | |||
21 | } | |||
22 | @@ -140,7 +141,7 @@ char *s; | |||
14 | { | 23 | { | |
15 | int zero = 0, one = 1; | 24 | int zero = 0, one = 1; | |
16 | int tmp; | 25 | int tmp; | |
17 | - char *p, *malloc(); | 26 | - char *p, *malloc(); | |
18 | + char *p; | 27 | + char *p; | |
19 | 28 | |||
20 | switch(type) { | 29 | switch(type) { | |
21 | case V_CHAR: | 30 | case V_CHAR: | |
31 | @@ -312,7 +313,7 @@ varsanity() | |||
32 | ||||
33 | } | |||
34 | ||||
35 | -restrict() | |||
36 | +restricted() | |||
37 | { | |||
38 | gv.restricted = 1; | |||
39 | tclrestrict(); |
@@ -1,25 +1,34 @@ | @@ -1,25 +1,34 @@ | |||
1 | $NetBSD: patch-am,v 1.3 2008/12/17 02:19:59 christos Exp $ | 1 | $NetBSD: patch-am,v 1.4 2013/01/11 13:24:32 joerg Exp $ | |
2 | 2 | |||
3 | --- icb/readlineinit.c.orig 1995-02-24 16:20:25.000000000 -0500 | 3 | --- icb/readlineinit.c.orig 1995-02-24 21:20:25.000000000 +0000 | |
4 | +++ icb/readlineinit.c 2008-12-16 20:18:01.000000000 -0500 | 4 | +++ icb/readlineinit.c | |
5 | @@ -1,4 +1,6 @@ | 5 | @@ -1,4 +1,6 @@ | |
6 | #include <readline.h> | 6 | #include <readline.h> | |
7 | +#include <stdlib.h> | 7 | +#include <stdlib.h> | |
8 | +#include <unistd.h> | 8 | +#include <unistd.h> | |
9 | #include "icb.h" | 9 | #include "icb.h" | |
10 | #include "externs.h" | 10 | #include "externs.h" | |
11 | 11 | |||
12 | @@ -21,12 +23,12 @@ | 12 | @@ -9,7 +11,7 @@ | |
13 | readlineinit() | |||
14 | { | |||
15 | char *editor; | |||
16 | -int handletab(); | |||
17 | +int handletab(int, int); | |||
18 | ||||
19 | /* | |||
20 | * bind the tab key | |||
21 | @@ -21,12 +23,12 @@ rl_bind_key_in_map('\t', handletab, emac | |||
13 | rl_vi_editing_mode(); /* default to vi, dammit. */ | 22 | rl_vi_editing_mode(); /* default to vi, dammit. */ | |
14 | gv.editmode = "vi"; | 23 | gv.editmode = "vi"; | |
15 | 24 | |||
16 | -editor = (char *)getenv("EDITOR"); | 25 | -editor = (char *)getenv("EDITOR"); | |
17 | +editor = getenv("EDITOR"); | 26 | +editor = getenv("EDITOR"); | |
18 | if (!editor) | 27 | if (!editor) | |
19 | - editor = (char *)getenv("VISUAL"); | 28 | - editor = (char *)getenv("VISUAL"); | |
20 | + editor = getenv("VISUAL"); | 29 | + editor = getenv("VISUAL"); | |
21 | 30 | |||
22 | if (editor != NULL) | 31 | if (editor != NULL) | |
23 | - if (strcmp((char *)basename(editor),"emacs")==0) | 32 | - if (strcmp((char *)basename(editor),"emacs")==0) | |
24 | + if (strcmp(basename(editor),"emacs")==0) | 33 | + if (strcmp(basename(editor),"emacs")==0) | |
25 | { | 34 | { |
@@ -1,54 +1,117 @@ | @@ -1,54 +1,117 @@ | |||
1 | $NetBSD: patch-al,v 1.4 2012/02/16 14:13:15 hans Exp $ | 1 | $NetBSD: patch-al,v 1.5 2013/01/11 13:24:32 joerg Exp $ | |
2 | 2 | |||
3 | --- icb/protos.h.orig 1995-02-24 21:20:25.000000000 +0000 | 3 | --- icb/protos.h.orig 1995-02-24 21:20:25.000000000 +0000 | |
4 | +++ icb/protos.h | 4 | +++ icb/protos.h | |
5 | @@ -49,7 +49,7 @@ int filtertext(char *s); | 5 | @@ -19,7 +19,7 @@ char *strscat(int va_alist,...); | |
6 | char *tildexpand(char *s); | |||
7 | int addusage(char *name, int type, char *args, char *usage); | |||
8 | sighandler askquit(); | |||
9 | -int beep(char *pkt); | |||
10 | +void beep(char *pkt); | |||
11 | int bufferadd(char *text); | |||
12 | int bufferlist(int lines); | |||
13 | int c_help(char *clientData, Tcl_Interp *interp, int argc, char *argv[]); | |||
14 | @@ -34,10 +34,10 @@ int c_usage(char *clientData, Tcl_Interp | |||
15 | char *catargs(char **argv); | |||
16 | int cimatch(char *s1, char *s2); | |||
17 | int clearargs(int argc, char *argv[]); | |||
18 | -int closesessionlog(void); | |||
19 | +void closesessionlog(void); | |||
20 | int cmdoutmsg(char *pkt); | |||
21 | -int copenmsg(char *pkt); | |||
22 | -int cpersonalmsg(char *pkt); | |||
23 | +void copenmsg(char *pkt); | |||
24 | +void cpersonalmsg(char *pkt); | |||
25 | int csendopen(char *txt); | |||
26 | int deleteusage(char *name); | |||
27 | int dispatch(char *pkt); | |||
28 | @@ -49,22 +49,23 @@ int filtertext(char *s); | |||
6 | int fnexit(void); | 29 | int fnexit(void); | |
7 | int fnterm(void); | 30 | int fnterm(void); | |
8 | int oset(char *clientData, Tcl_Interp *interp, int argc, char *argv[]); | 31 | int oset(char *clientData, Tcl_Interp *interp, int argc, char *argv[]); | |
9 | -char *getline(char *prompt, int expand); | 32 | -char *getline(char *prompt, int expand); | |
10 | +char *get_line(char *prompt, int expand); | 33 | +char *get_line(char *prompt, int expand); | |
11 | int getterm(void); | 34 | int getterm(void); | |
12 | int getwinsize(void); | 35 | int getwinsize(void); | |
13 | int gunlink(USAGE *u, USAGE **first, USAGE **last); | 36 | int gunlink(USAGE *u, USAGE **first, USAGE **last); | |
14 | @@ -64,7 +64,7 @@ int importantmsg(char *pkt); | 37 | int helpme(char *subject); | |
38 | int helptoc(void); | |||
39 | int histcount(void); | |||
40 | -int histput(char *nick); | |||
41 | +void histput(char *nick); | |||
42 | int hushadd(Tcl_Interp *interp, char *nick); | |||
43 | int hushdelete(Tcl_Interp *interp, char *nick); | |||
44 | -int hushlist(void); | |||
45 | -int importantmsg(char *pkt); | |||
46 | +void hushlist(void); | |||
47 | +void importantmsg(char *pkt); | |||
48 | +void icbterm(void); | |||
15 | int inserttab(void); | 49 | int inserttab(void); | |
16 | int ishushed(char *nick); | 50 | int ishushed(char *nick); | |
17 | int lcaseit(char *s); | 51 | int lcaseit(char *s); | |
18 | -#ifdef linux | 52 | -#ifdef linux | |
19 | +#if defined(linux) || (defined(BSD) && BSD >= 199306) || defined(__sun) | 53 | +#if defined(linux) || (defined(BSD) && BSD >= 199306) || defined(__sun) | |
20 | int linebuffer(FILE *fp); | 54 | int linebuffer(FILE *fp); | |
21 | #else | 55 | #else | |
22 | int linebuffer(struct _iobuf *fp); | 56 | int linebuffer(struct _iobuf *fp); | |
23 | @@ -78,7 +78,7 @@ int mbreakprint(int per, char *from, cha | 57 | @@ -77,18 +78,18 @@ int main(int argc, char **argv); | |
58 | int mbreakprint(int per, char *from, char *s); | |||
24 | int mprint(int per, char *from, char *s); | 59 | int mprint(int per, char *from, char *s); | |
25 | int numeric(char *txt); | 60 | int numeric(char *txt); | |
26 | int parse(char *s); | 61 | -int parse(char *s); | |
27 | -int pauseprompt(char *prompt, int erase, int c, int unget, int except); | 62 | -int pauseprompt(char *prompt, int erase, int c, int unget, int except); | |
63 | +void parse(char *s); | |||
28 | +int pauseprompt(char *prompt, int erase, int c, int unget, char *except); | 64 | +int pauseprompt(char *prompt, int erase, int c, int unget, char *except); | |
29 | int printcutetime(void); | 65 | int printcutetime(void); | |
30 | int printmilitarytime(void); | 66 | int printmilitarytime(void); | |
31 | int printnormaltime(void); | 67 | int printnormaltime(void); | |
32 | @@ -107,7 +107,7 @@ int specialchar(register int c, char *s, | 68 | int printvar(char *name, int type, char *address); | |
69 | -int protomsg(char *pkt); | |||
70 | +void protomsg(char *pkt); | |||
71 | int pushback(int c); | |||
72 | int putl(char *s, int flags); | |||
73 | int quoteify(char *a, char *b); | |||
74 | -int restoreterm(void); | |||
75 | -int restrict(void); | |||
76 | +void restoreterm(void); | |||
77 | +int restricted(void); | |||
78 | int s_admin(char *clientData, Tcl_Interp *interp, int argc, char *argv[]); | |||
79 | int s_beep(char *clientData, Tcl_Interp *interp, int argc, char *argv[]); | |||
80 | int s_group(char *clientData, Tcl_Interp *interp, int argc, char *argv[]); | |||
81 | @@ -100,14 +101,14 @@ int s_who(char *clientData, Tcl_Interp * | |||
82 | int saysomething(void); | |||
83 | int sendcmd(char *cmd, char *args); | |||
84 | int sendlogin(char *id, char *nick, char *group, char *command, char *passwd); | |||
85 | -int sendpersonal(char *nick, char *text, int echoflag); | |||
86 | +void sendpersonal(char *nick, char *text, int echoflag); | |||
87 | int sendpong(void); | |||
88 | int setvar(Tcl_Interp *interp, int type, char *address, char *s); | |||
89 | int specialchar(register int c, char *s, char *prompt, int expand); | |||
33 | int split(char *s); | 90 | int split(char *s); | |
34 | int startsessionlog(Tcl_Interp *interp, char *path); | 91 | int startsessionlog(Tcl_Interp *interp, char *path); | |
35 | int statusmsg(char *pkt); | 92 | -int statusmsg(char *pkt); | |
36 | -int strcasecmp(char *s1, char *s2); | 93 | -int strcasecmp(char *s1, char *s2); | |
94 | +void statusmsg(char *pkt); | |||
37 | +int strcasecmp(const char *s1, const char *s2); | 95 | +int strcasecmp(const char *s1, const char *s2); | |
38 | int strcicmp(char *s1, char *s2); | 96 | int strcicmp(char *s1, char *s2); | |
39 | int strcincmp(char *s1, char *s2, int n); | 97 | int strcincmp(char *s1, char *s2, int n); | |
40 | int strlinkafter(STRLIST *s, STRLIST *i, STRLIST **head, STRLIST **tail); | 98 | int strlinkafter(STRLIST *s, STRLIST *i, STRLIST **head, STRLIST **tail); | |
41 | @@ -115,7 +115,7 @@ int strlinkalpha(STRLIST *s, STRLIST **h | 99 | @@ -115,11 +116,11 @@ int strlinkalpha(STRLIST *s, STRLIST **h | |
42 | int strlinkbefore(STRLIST *s, STRLIST *i, STRLIST **head, STRLIST **tail); | 100 | int strlinkbefore(STRLIST *s, STRLIST *i, STRLIST **head, STRLIST **tail); | |
43 | int strlinkhead(STRLIST *s, STRLIST **head, STRLIST **tail); | 101 | int strlinkhead(STRLIST *s, STRLIST **head, STRLIST **tail); | |
44 | int strlinktail(STRLIST *s, STRLIST **head, STRLIST **tail); | 102 | int strlinktail(STRLIST *s, STRLIST **head, STRLIST **tail); | |
45 | -int strncasecmp(char *s1, char *s2, register int n); | 103 | -int strncasecmp(char *s1, char *s2, register int n); | |
46 | +int strncasecmp(const char *s1, const char *s2, size_t n); | 104 | +int strncasecmp(const char *s1, const char *s2, size_t n); | |
47 | int strunlink(STRLIST *s, STRLIST **head, STRLIST **tail); | 105 | int strunlink(STRLIST *s, STRLIST **head, STRLIST **tail); | |
48 | sighandler suspend(); | 106 | sighandler suspend(); | |
49 | int tclinit(void); | 107 | int tclinit(void); | |
50 | @@ -140,3 +140,4 @@ struct server *getserver(void); | 108 | -int tclreadicbrc(void); | |
109 | +void tclreadicbrc(void); | |||
110 | int tclrestrict(void); | |||
111 | int trapsignals(void); | |||
112 | int uline(USAGE *u); | |||
113 | @@ -140,3 +141,4 @@ struct server *getserver(void); | |||
51 | struct server *getservbyname(char *name); | 114 | struct server *getservbyname(char *name); | |
52 | void listservers(void); | 115 | void listservers(void); | |
53 | sighandler icbexit(); | 116 | sighandler icbexit(); | |
54 | +char *basename(char *); | 117 | +char *basename(char *); |
@@ -1,122 +1,783 @@ | @@ -1,122 +1,783 @@ | |||
1 | $NetBSD: patch-an,v 1.4 2008/12/17 02:19:59 christos Exp $ | 1 | $NetBSD: patch-an,v 1.5 2013/01/11 13:24:32 joerg Exp $ | |
2 | 2 | |||
3 | $NetBSD: patch-an,v 1.4 2008/12/17 02:19:59 christos Exp $ | 3 | --- readline/readline.c.orig 1995-02-24 21:20:03.000000000 +0000 | |
4 | 4 | +++ readline/readline.c | ||
5 | --- readline/readline.c.orig 1995-02-24 16:20:03.000000000 -0500 | 5 | @@ -38,17 +38,25 @@ static char *xmalloc (), *xrealloc (); | |
6 | +++ readline/readline.c 2006-05-15 10:41:51.000000000 -0400 | 6 | # endif | |
7 | @@ -43,12 +43,18 @@ | 7 | #endif | |
8 | ||||
9 | +#include <unistd.h> | |||
10 | +#include <termcap.h> | |||
11 | #include <stdio.h> | |||
12 | #include <sys/types.h> | |||
8 | #include <fcntl.h> | 13 | #include <fcntl.h> | |
9 | #include <sys/file.h> | 14 | #include <sys/file.h> | |
10 | #include <signal.h> | 15 | #include <signal.h> | |
11 | +#include <stdlib.h> | 16 | +#include <stdlib.h> | |
12 | +#include <readline/readline.h> | 17 | +#include <readline/readline.h> | |
13 | 18 | |||
14 | #if defined (HAVE_UNISTD_H) | 19 | #if defined (HAVE_UNISTD_H) | |
15 | # include <unistd.h> | 20 | # include <unistd.h> | |
16 | #endif | 21 | #endif | |
17 | 22 | |||
18 | +#if !defined(__linux__) | 23 | +#if !defined(__linux__) | |
19 | #define NEW_TTY_DRIVER | 24 | #define NEW_TTY_DRIVER | |
20 | +#else | 25 | +#else | |
21 | +#define TERMIOS_TTY_DRIVER | 26 | +#define TERMIOS_TTY_DRIVER | |
22 | +#endif | 27 | +#endif | |
23 | #define HAVE_BSD_SIGNALS | 28 | #define HAVE_BSD_SIGNALS | |
24 | /* #define USE_XON_XOFF */ | 29 | /* #define USE_XON_XOFF */ | |
25 | 30 | |||
26 | @@ -80,6 +86,10 @@ | 31 | @@ -80,6 +88,10 @@ static char *xmalloc (), *xrealloc (); | |
27 | # if !defined (O_NDELAY) | 32 | # if !defined (O_NDELAY) | |
28 | # define O_NDELAY O_NONBLOCK /* Posix-style non-blocking i/o */ | 33 | # define O_NDELAY O_NONBLOCK /* Posix-style non-blocking i/o */ | |
29 | # endif /* O_NDELAY */ | 34 | # endif /* O_NDELAY */ | |
30 | +#else | 35 | +#else | |
31 | +# ifdef TERMIOS_TTY_DRIVER | 36 | +# ifdef TERMIOS_TTY_DRIVER | |
32 | +# include <termios.h> | 37 | +# include <termios.h> | |
33 | +# endif /* !TERMIOS_MISSING */ | 38 | +# endif /* !TERMIOS_MISSING */ | |
34 | #endif /* _POSIX_VERSION */ | 39 | #endif /* _POSIX_VERSION */ | |
35 | 40 | |||
36 | /* Other (BSD) machines use sgtty. */ | 41 | /* Other (BSD) machines use sgtty. */ | |
37 | @@ -104,7 +114,6 @@ | 42 | @@ -104,7 +116,6 @@ static char *xmalloc (), *xrealloc (); | |
38 | #endif /* !NEW_TTY_DRIVER && !_POSIX_VDISABLE */ | 43 | #endif /* !NEW_TTY_DRIVER && !_POSIX_VDISABLE */ | |
39 | 44 | |||
40 | #include <errno.h> | 45 | #include <errno.h> | |
41 | -extern int errno; | 46 | -extern int errno; | |
42 | 47 | |||
43 | #include <setjmp.h> | 48 | #include <setjmp.h> | |
44 | #if defined (SHELL) | 49 | #if defined (SHELL) | |
45 | @@ -133,7 +142,7 @@ | 50 | @@ -133,7 +144,7 @@ struct passwd *getpwuid (), *getpwent () | |
46 | # endif /* USGr3 */ | 51 | # endif /* USGr3 */ | |
47 | #endif /* USG && hpux */ | 52 | #endif /* USG && hpux */ | |
48 | 53 | |||
49 | -#if defined (_POSIX_VERSION) || defined (USGr3) | 54 | -#if defined (_POSIX_VERSION) || defined (USGr3) | |
50 | +#if defined (_POSIX_VERSION) || defined (USGr3) || defined(__linux__) | 55 | +#if defined (_POSIX_VERSION) || defined (USGr3) || defined(__linux__) | |
51 | # include <dirent.h> | 56 | # include <dirent.h> | |
52 | # define direct dirent | 57 | # define direct dirent | |
53 | # if defined (_POSIX_VERSION) | 58 | # if defined (_POSIX_VERSION) | |
54 | @@ -280,7 +289,7 @@ | 59 | @@ -204,10 +215,13 @@ extern char *index (); | |
60 | extern char *getenv (); | |||
61 | extern char *tilde_expand (); | |||
62 | ||||
63 | -static update_line (); | |||
64 | +static void update_line (char *, char *, int); | |||
65 | static void output_character_function (); | |||
66 | -static delete_chars (); | |||
67 | +static void delete_chars (int); | |||
68 | static insert_some_chars (); | |||
69 | +static void move_vert (int to); | |||
70 | +static void rl_digit_loop (void); | |||
71 | +static void free_history_entry(HIST_ENTRY *entry); | |||
72 | ||||
73 | #if defined (VOID_SIGHANDLER) | |||
74 | # define sighandler void | |||
75 | @@ -280,7 +294,7 @@ static jmp_buf readline_top_level; | |||
55 | static FILE *in_stream, *out_stream; | 76 | static FILE *in_stream, *out_stream; | |
56 | 77 | |||
57 | /* The names of the streams that we do input and output to. */ | 78 | /* The names of the streams that we do input and output to. */ | |
58 | -FILE *rl_instream = stdin, *rl_outstream = stdout; | 79 | -FILE *rl_instream = stdin, *rl_outstream = stdout; | |
59 | +FILE *rl_instream = NULL, *rl_outstream = NULL; | 80 | +FILE *rl_instream = NULL, *rl_outstream = NULL; | |
60 | 81 | |||
61 | /* Non-zero means echo characters as they are read. */ | 82 | /* Non-zero means echo characters as they are read. */ | |
62 | int readline_echoing_p = 1; | 83 | int readline_echoing_p = 1; | |
63 | @@ -1152,6 +1161,8 @@ | 84 | @@ -335,6 +349,8 @@ static int stricmp (), strnicmp (); | |
85 | /* Non-zero means to save keys that we dispatch on in a kbd macro. */ | |||
86 | static int defining_kbd_macro = 0; | |||
87 | ||||
88 | +static void init_terminal_io (char *terminal_name); | |||
89 | + | |||
90 | ||||
91 | /* **************************************************************** */ | |||
92 | /* */ | |||
93 | @@ -744,7 +760,7 @@ rl_unget_char (key) | |||
94 | ||||
95 | /* If a character is available to be read, then read it | |||
96 | and stuff it into IBUFFER. Otherwise, just return. */ | |||
97 | -rl_gather_tyi () | |||
98 | +static void rl_gather_tyi (void) | |||
99 | { | |||
100 | int tty = fileno (in_stream); | |||
101 | register int tem, result = -1; | |||
102 | @@ -861,7 +877,7 @@ rl_dispatch (key, map) | |||
103 | } | |||
104 | else | |||
105 | ding (); | |||
106 | - return; | |||
107 | + return 0; | |||
108 | } | |||
109 | ||||
110 | switch (map[key].type) | |||
111 | @@ -876,7 +892,7 @@ rl_dispatch (key, map) | |||
112 | if (func == rl_do_lowercase_version) | |||
113 | { | |||
114 | rl_dispatch (to_lower (key), map); | |||
115 | - return; | |||
116 | + return 0; | |||
117 | } | |||
118 | ||||
119 | (*map[key].function)(rl_numeric_arg * rl_arg_sign, key); | |||
120 | @@ -890,7 +906,7 @@ rl_dispatch (key, map) | |||
121 | else | |||
122 | { | |||
123 | rl_abort (); | |||
124 | - return; | |||
125 | + return 0; | |||
126 | } | |||
127 | } | |||
128 | break; | |||
129 | @@ -907,7 +923,7 @@ rl_dispatch (key, map) | |||
130 | else | |||
131 | { | |||
132 | rl_abort (); | |||
133 | - return; | |||
134 | + return 0; | |||
135 | } | |||
136 | break; | |||
137 | ||||
138 | @@ -918,10 +934,11 @@ rl_dispatch (key, map) | |||
139 | ||||
140 | macro = savestring ((char *)map[key].function); | |||
141 | with_macro_input (macro); | |||
142 | - return; | |||
143 | + return 0; | |||
144 | } | |||
145 | break; | |||
146 | } | |||
147 | + return 0; | |||
148 | } | |||
149 | ||||
150 | ||||
151 | @@ -1152,6 +1169,8 @@ readline_initialize_everything () | |||
64 | { | 152 | { | |
65 | /* Find out if we are running in Emacs. */ | 153 | /* Find out if we are running in Emacs. */ | |
66 | running_in_emacs = getenv ("EMACS"); | 154 | running_in_emacs = getenv ("EMACS"); | |
67 | + rl_instream = stdin; | 155 | + rl_instream = stdin; | |
68 | + rl_outstream = stdout; | 156 | + rl_outstream = stdout; | |
69 | 157 | |||
70 | /* Allocate data structures. */ | 158 | /* Allocate data structures. */ | |
71 | if (!rl_line_buffer) | 159 | if (!rl_line_buffer) | |
72 | @@ -2505,7 +2516,11 @@ | 160 | @@ -1320,7 +1339,7 @@ rl_universal_argument () | |
161 | rl_digit_loop (); | |||
162 | } | |||
163 | ||||
164 | -rl_digit_loop () | |||
165 | +static void rl_digit_loop (void) | |||
166 | { | |||
167 | int key, c; | |||
168 | while (1) | |||
169 | @@ -1450,7 +1469,7 @@ static void output_character_function () | |||
170 | static int compare_strings (); | |||
171 | ||||
172 | /* Basic redisplay algorithm. */ | |||
173 | -rl_redisplay () | |||
174 | +void rl_redisplay (void) | |||
175 | { | |||
176 | register int in, out, c, linenum; | |||
177 | register char *line = invisible_line; | |||
178 | @@ -1677,10 +1696,8 @@ new: eddie> Oh, my little buggy says to | |||
179 | no differences, as well as for end of line additions must be handeled. | |||
180 | ||||
181 | Could be made even smarter, but this works well enough */ | |||
182 | -static | |||
183 | -update_line (old, new, current_line) | |||
184 | - register char *old, *new; | |||
185 | - int current_line; | |||
186 | +static void | |||
187 | +update_line (char *old, char *new, int current_line) | |||
188 | { | |||
189 | register char *ofd, *ols, *oe, *nfd, *nls, *ne; | |||
190 | int lendiff, wsatend; | |||
191 | @@ -1872,8 +1889,7 @@ move_cursor_relative (new, data) | |||
192 | } | |||
193 | ||||
194 | /* PWP: move the cursor up or down. */ | |||
195 | -move_vert (to) | |||
196 | - int to; | |||
197 | +static void move_vert (int to) | |||
198 | { | |||
199 | void output_character_function (); | |||
200 | register int delta, i; | |||
201 | @@ -2018,8 +2034,7 @@ rl_reset_terminal (terminal_name) | |||
202 | init_terminal_io (terminal_name); | |||
203 | } | |||
204 | ||||
205 | -init_terminal_io (terminal_name) | |||
206 | - char *terminal_name; | |||
207 | +static void init_terminal_io (char *terminal_name) | |||
208 | { | |||
209 | extern char *tgetstr (); | |||
210 | char *term, *buffer; | |||
211 | @@ -2158,9 +2173,8 @@ output_some_chars (string, count) | |||
212 | } | |||
213 | ||||
214 | /* Delete COUNT characters from the display line. */ | |||
215 | -static | |||
216 | -delete_chars (count) | |||
217 | - int count; | |||
218 | +static void | |||
219 | +delete_chars (int count) | |||
220 | { | |||
221 | if (count > screenwidth) | |||
222 | return; | |||
223 | @@ -2505,7 +2519,11 @@ rl_prep_terminal () | |||
73 | 224 | |||
74 | tio.c_lflag &= ~(ICANON | ECHO); | 225 | tio.c_lflag &= ~(ICANON | ECHO); | |
75 | 226 | |||
76 | - if (otio.c_cc[VEOF] != _POSIX_VDISABLE) | 227 | - if (otio.c_cc[VEOF] != _POSIX_VDISABLE) | |
77 | +#ifdef ONLCR | 228 | +#ifdef ONLCR | |
78 | + tio.c_oflag |= OPOST|ONLCR; | 229 | + tio.c_oflag |= OPOST|ONLCR; | |
79 | +#endif | 230 | +#endif | |
80 | + | 231 | + | |
81 | + if ((unsigned char)otio.c_cc[VEOF] != (unsigned char)_POSIX_VDISABLE) | 232 | + if ((unsigned char)otio.c_cc[VEOF] != (unsigned char)_POSIX_VDISABLE) | |
82 | eof_char = otio.c_cc[VEOF]; | 233 | eof_char = otio.c_cc[VEOF]; | |
83 | 234 | |||
84 | #if defined (USE_XON_XOFF) | 235 | #if defined (USE_XON_XOFF) | |
85 | @@ -2637,7 +2652,7 @@ | 236 | @@ -2637,7 +2655,7 @@ alphabetic (c) | |
86 | return (1); | 237 | return (1); | |
87 | 238 | |||
88 | if (allow_pathname_alphabetic_chars) | 239 | if (allow_pathname_alphabetic_chars) | |
89 | - return ((int)rindex (pathname_alphabetic_chars, c)); | 240 | - return ((int)rindex (pathname_alphabetic_chars, c)); | |
90 | + return (rindex (pathname_alphabetic_chars, c) != NULL); | 241 | + return (rindex (pathname_alphabetic_chars, c) != NULL); | |
91 | else | 242 | else | |
92 | return (0); | 243 | return (0); | |
93 | } | 244 | } | |
94 | @@ -3570,7 +3585,7 @@ | 245 | @@ -2845,12 +2863,13 @@ rl_forward (count) | |
246 | #endif /* VI_MODE */ | |||
247 | { | |||
248 | ding (); | |||
249 | - return; | |||
250 | + return 0; | |||
251 | } | |||
252 | else | |||
253 | rl_point++; | |||
254 | --count; | |||
255 | } | |||
256 | + return 0; | |||
257 | } | |||
258 | ||||
259 | /* Move backward COUNT characters. */ | |||
260 | @@ -2865,12 +2884,13 @@ rl_backward (count) | |||
261 | if (!rl_point) | |||
262 | { | |||
263 | ding (); | |||
264 | - return; | |||
265 | + return 0; | |||
266 | } | |||
267 | else | |||
268 | --rl_point; | |||
269 | --count; | |||
270 | } | |||
271 | + return 0; | |||
272 | } | |||
273 | ||||
274 | /* Move to the beginning of the line. */ | |||
275 | @@ -2894,13 +2914,13 @@ rl_forward_word (count) | |||
276 | if (count < 0) | |||
277 | { | |||
278 | rl_backward_word (-count); | |||
279 | - return; | |||
280 | + return 0; | |||
281 | } | |||
282 | ||||
283 | while (count) | |||
284 | { | |||
285 | if (rl_point == rl_end) | |||
286 | - return; | |||
287 | + return 0; | |||
288 | ||||
289 | /* If we are not in a word, move forward until we are in one. | |||
290 | Then, move forward until we hit a non-alphabetic character. */ | |||
291 | @@ -2913,7 +2933,7 @@ rl_forward_word (count) | |||
292 | if (alphabetic (c)) break; | |||
293 | } | |||
294 | } | |||
295 | - if (rl_point == rl_end) return; | |||
296 | + if (rl_point == rl_end) return 0; | |||
297 | while (++rl_point < rl_end) | |||
298 | { | |||
299 | c = the_line[rl_point]; | |||
300 | @@ -2921,6 +2941,7 @@ rl_forward_word (count) | |||
301 | } | |||
302 | --count; | |||
303 | } | |||
304 | + return 0; | |||
305 | } | |||
306 | ||||
307 | /* Move backward a word. We do what Emacs does. */ | |||
308 | @@ -2932,13 +2953,13 @@ rl_backward_word (count) | |||
309 | if (count < 0) | |||
310 | { | |||
311 | rl_forward_word (-count); | |||
312 | - return; | |||
313 | + return 0; | |||
314 | } | |||
315 | ||||
316 | while (count) | |||
317 | { | |||
318 | if (!rl_point) | |||
319 | - return; | |||
320 | + return 0; | |||
321 | ||||
322 | /* Like rl_forward_word (), except that we look at the characters | |||
323 | just before point. */ | |||
324 | @@ -2962,6 +2983,7 @@ rl_backward_word (count) | |||
325 | } | |||
326 | --count; | |||
327 | } | |||
328 | + return 0; | |||
329 | } | |||
330 | ||||
331 | /* Clear the current line. Numeric argument to C-l does this. */ | |||
332 | @@ -2990,7 +3012,7 @@ rl_clear_screen () | |||
333 | if (rl_explicit_arg) | |||
334 | { | |||
335 | rl_refresh_line (); | |||
336 | - return; | |||
337 | + return 0; | |||
338 | } | |||
339 | ||||
340 | if (term_clrpag) | |||
341 | @@ -3000,6 +3022,7 @@ rl_clear_screen () | |||
342 | ||||
343 | rl_forced_update_display (); | |||
344 | rl_display_fixed = 1; | |||
345 | + return 0; | |||
346 | } | |||
347 | ||||
348 | rl_arrow_keys (count, c) | |||
349 | @@ -3047,7 +3070,7 @@ rl_insert (count, c) | |||
350 | char *string; | |||
351 | ||||
352 | if (count <= 0) | |||
353 | - return; | |||
354 | + return 0; | |||
355 | ||||
356 | /* If we can optimize, then do it. But don't let people crash | |||
357 | readline because of extra large arguments. */ | |||
358 | @@ -3060,7 +3083,7 @@ rl_insert (count, c) | |||
359 | ||||
360 | string[i] = '\0'; | |||
361 | rl_insert_text (string); | |||
362 | - return; | |||
363 | + return 0; | |||
364 | } | |||
365 | ||||
366 | if (count > 1024) | |||
367 | @@ -3079,7 +3102,7 @@ rl_insert (count, c) | |||
368 | rl_insert_text (string); | |||
369 | count -= decreaser; | |||
370 | } | |||
371 | - return; | |||
372 | + return 0; | |||
373 | } | |||
374 | ||||
375 | /* We are inserting a single character. | |||
376 | @@ -3104,7 +3127,6 @@ rl_insert (count, c) | |||
377 | ||||
378 | string[i] = '\0'; | |||
379 | rl_insert_text (string); | |||
380 | - return; | |||
381 | } | |||
382 | else | |||
383 | { | |||
384 | @@ -3115,6 +3137,7 @@ rl_insert (count, c) | |||
385 | string[0] = c; | |||
386 | rl_insert_text (string); | |||
387 | } | |||
388 | + return 0; | |||
389 | } | |||
390 | ||||
391 | /* Insert the next typed character verbatim. */ | |||
392 | @@ -3127,9 +3150,10 @@ rl_quoted_insert (count) | |||
393 | if (c==0x01) | |||
394 | { | |||
395 | printf("\007"); | |||
396 | - return; | |||
397 | + return 0; | |||
398 | } | |||
399 | rl_insert (count, c); | |||
400 | + return 0; | |||
401 | } | |||
402 | ||||
403 | /* Insert a tab character. */ | |||
404 | @@ -3196,14 +3220,14 @@ rl_rubout (count) | |||
405 | if (count < 0) | |||
406 | { | |||
407 | rl_delete (-count); | |||
408 | - return; | |||
409 | + return 0; | |||
410 | } | |||
411 | ||||
412 | if (!rl_point) | |||
413 | { | |||
414 | ding (); | |||
415 | last_command_was_kill++; | |||
416 | - return; | |||
417 | + return 0; | |||
418 | } | |||
419 | ||||
420 | if (count > 1) | |||
421 | @@ -3228,6 +3252,7 @@ rl_rubout (count) | |||
422 | rl_display_fixed++; | |||
423 | } | |||
424 | } | |||
425 | + return 0; | |||
426 | } | |||
427 | ||||
428 | /* Delete the character under the cursor. Given a numeric argument, | |||
429 | @@ -3238,13 +3263,13 @@ rl_delete (count, invoking_key) | |||
430 | if (count < 0) | |||
431 | { | |||
432 | rl_rubout (-count); | |||
433 | - return; | |||
434 | + return 0; | |||
435 | } | |||
436 | ||||
437 | if (rl_point == rl_end) | |||
438 | { | |||
439 | ding (); | |||
440 | - return; | |||
441 | + return 0; | |||
442 | } | |||
443 | ||||
444 | if (count > 1) | |||
445 | @@ -3256,6 +3281,7 @@ rl_delete (count, invoking_key) | |||
446 | } | |||
447 | else | |||
448 | rl_delete_text (rl_point, rl_point + 1); | |||
449 | + return 0; | |||
450 | } | |||
451 | ||||
452 | ||||
453 | @@ -3412,7 +3438,7 @@ rl_transpose_words (count) | |||
454 | int w1_beg, w1_end, w2_beg, w2_end; | |||
455 | int orig_point = rl_point; | |||
456 | ||||
457 | - if (!count) return; | |||
458 | + if (!count) return 0; | |||
459 | ||||
460 | /* Find the two words. */ | |||
461 | rl_forward_word (count); | |||
462 | @@ -3429,7 +3455,7 @@ rl_transpose_words (count) | |||
463 | { | |||
464 | ding (); | |||
465 | rl_point = orig_point; | |||
466 | - return; | |||
467 | + return 0; | |||
468 | } | |||
469 | ||||
470 | /* Get the text of the words. */ | |||
471 | @@ -3457,6 +3483,7 @@ rl_transpose_words (count) | |||
472 | /* I think that does it. */ | |||
473 | rl_end_undo_group (); | |||
474 | free (word1); free (word2); | |||
475 | + return 0; | |||
476 | } | |||
477 | ||||
478 | /* Transpose the characters at point. If point is at the end of the line, | |||
479 | @@ -3465,11 +3492,11 @@ rl_transpose_chars (count) | |||
480 | int count; | |||
481 | { | |||
482 | if (!count) | |||
483 | - return; | |||
484 | + return 0; | |||
485 | ||||
486 | if (!rl_point || rl_end < 2) { | |||
487 | ding (); | |||
488 | - return; | |||
489 | + return 0; | |||
490 | } | |||
491 | ||||
492 | while (count) | |||
493 | @@ -3499,6 +3526,7 @@ rl_transpose_chars (count) | |||
494 | else | |||
495 | count--; | |||
496 | } | |||
497 | + return 0; | |||
498 | } | |||
499 | ||||
500 | ||||
501 | @@ -3570,7 +3598,7 @@ Function *rl_completion_entry_function = | |||
95 | If this function exists and returns NULL then call the value of | 502 | If this function exists and returns NULL then call the value of | |
96 | rl_completion_entry_function to try to match, otherwise use the | 503 | rl_completion_entry_function to try to match, otherwise use the | |
97 | array of strings returned. */ | 504 | array of strings returned. */ | |
98 | -Function *rl_attempted_completion_function = (Function *)NULL; | 505 | -Function *rl_attempted_completion_function = (Function *)NULL; | |
99 | +CPPFunction *rl_attempted_completion_function = (CPPFunction *)NULL; | 506 | +CPPFunction *rl_attempted_completion_function = (CPPFunction *)NULL; | |
100 | 507 | |||
101 | /* Local variable states what happened during the last completion attempt. */ | 508 | /* Local variable states what happened during the last completion attempt. */ | |
102 | static int completion_changed_buffer = 0; | 509 | static int completion_changed_buffer = 0; | |
103 | @@ -3706,8 +3721,7 @@ | 510 | @@ -3706,8 +3734,7 @@ rl_complete_internal (what_to_do) | |
104 | variable rl_attempted_completion_function. */ | 511 | variable rl_attempted_completion_function. */ | |
105 | if (rl_attempted_completion_function) | 512 | if (rl_attempted_completion_function) | |
106 | { | 513 | { | |
107 | - matches = | 514 | - matches = | |
108 | - (char **)(*rl_attempted_completion_function) (text, start, end); | 515 | - (char **)(*rl_attempted_completion_function) (text, start, end); | |
109 | + matches = (*rl_attempted_completion_function) (text, start, end); | 516 | + matches = (*rl_attempted_completion_function) (text, start, end); | |
110 | 517 | |||
111 | if (matches) | 518 | if (matches) | |
112 | { | 519 | { | |
113 | @@ -3760,8 +3774,7 @@ | 520 | @@ -3760,8 +3787,7 @@ rl_complete_internal (what_to_do) | |
114 | /* We have marked all the dead slots with (char *)-1. | 521 | /* We have marked all the dead slots with (char *)-1. | |
115 | Copy all the non-dead entries into a new array. */ | 522 | Copy all the non-dead entries into a new array. */ | |
116 | { | 523 | { | |
117 | - char **temp_array = | 524 | - char **temp_array = | |
118 | - (char **)malloc ((3 + newlen) * sizeof (char *)); | 525 | - (char **)malloc ((3 + newlen) * sizeof (char *)); | |
119 | + char **temp_array = malloc ((3 + newlen) * sizeof (char *)); | 526 | + char **temp_array = malloc ((3 + newlen) * sizeof (char *)); | |
120 | 527 | |||
121 | for (i = 1, j = 1; matches[i]; i++) | 528 | for (i = 1, j = 1; matches[i]; i++) | |
122 | { | 529 | { | |
530 | @@ -4236,7 +4262,7 @@ rl_revert_line () | |||
531 | /* Do some undoing of things that were done. */ | |||
532 | rl_undo_command (count) | |||
533 | { | |||
534 | - if (count < 0) return; /* Nothing to do. */ | |||
535 | + if (count < 0) return 0; /* Nothing to do. */ | |||
536 | ||||
537 | while (count) | |||
538 | { | |||
539 | @@ -4250,6 +4276,7 @@ rl_undo_command (count) | |||
540 | break; | |||
541 | } | |||
542 | } | |||
543 | + return 0; | |||
544 | } | |||
545 | ||||
546 | /* **************************************************************** */ | |||
547 | @@ -4277,8 +4304,7 @@ start_using_history () | |||
548 | } | |||
549 | ||||
550 | /* Free the contents (and containing structure) of a HIST_ENTRY. */ | |||
551 | -free_history_entry (entry) | |||
552 | - HIST_ENTRY *entry; | |||
553 | +static void free_history_entry(HIST_ENTRY *entry) | |||
554 | { | |||
555 | if (!entry) return; | |||
556 | if (entry->line) | |||
557 | @@ -4362,11 +4388,11 @@ rl_get_next_history (count) | |||
558 | if (count < 0) | |||
559 | { | |||
560 | rl_get_previous_history (-count); | |||
561 | - return; | |||
562 | + return 0; | |||
563 | } | |||
564 | ||||
565 | if (!count) | |||
566 | - return; | |||
567 | + return 0; | |||
568 | ||||
569 | maybe_replace_line (); | |||
570 | ||||
571 | @@ -4397,6 +4423,7 @@ rl_get_next_history (count) | |||
572 | rl_point = 0; | |||
573 | #endif /* VI_MODE */ | |||
574 | } | |||
575 | + return 0; | |||
576 | } | |||
577 | ||||
578 | /* Get the previous item out of our interactive history, making it the current | |||
579 | @@ -4410,11 +4437,11 @@ rl_get_previous_history (count) | |||
580 | if (count < 0) | |||
581 | { | |||
582 | rl_get_next_history (-count); | |||
583 | - return; | |||
584 | + return 0; | |||
585 | } | |||
586 | ||||
587 | if (!count) | |||
588 | - return; | |||
589 | + return 0; | |||
590 | ||||
591 | /* If we don't have a line saved, then save this one. */ | |||
592 | maybe_save_line (); | |||
593 | @@ -4457,6 +4484,7 @@ rl_get_previous_history (count) | |||
594 | rl_point = 0; | |||
595 | #endif /* VI_MODE */ | |||
596 | } | |||
597 | + return 0; | |||
598 | } | |||
599 | ||||
600 | ||||
601 | @@ -4643,7 +4671,7 @@ rl_search_history (direction, invoking_k | |||
602 | rl_point = orig_point; | |||
603 | rl_end = strlen (the_line); | |||
604 | rl_clear_message (); | |||
605 | - return; | |||
606 | + return 0; | |||
607 | ||||
608 | default: | |||
609 | if (c < 32 || c > 126) | |||
610 | @@ -4779,6 +4807,7 @@ rl_search_history (direction, invoking_k | |||
611 | rl_point = index; | |||
612 | rl_clear_message (); | |||
613 | } | |||
614 | + return 0; | |||
615 | } | |||
616 | ||||
617 | /* Make C be the next command to be executed. */ | |||
618 | @@ -4831,7 +4860,7 @@ rl_kill_text (from, to) | |||
619 | { | |||
620 | free (text); | |||
621 | last_command_was_kill++; | |||
622 | - return; | |||
623 | + return 0; | |||
624 | } | |||
625 | ||||
626 | /* Delete the copied text from the line. */ | |||
627 | @@ -4902,6 +4931,7 @@ rl_kill_text (from, to) | |||
628 | } | |||
629 | rl_kill_index = slot; | |||
630 | last_command_was_kill++; | |||
631 | + return 0; | |||
632 | } | |||
633 | ||||
634 | /* Now REMEMBER! In order to do prepending or appending correctly, kill | |||
635 | @@ -5039,14 +5069,14 @@ rl_yank_nth_arg (count, ignore) | |||
636 | else | |||
637 | { | |||
638 | ding (); | |||
639 | - return; | |||
640 | + return 0; | |||
641 | } | |||
642 | ||||
643 | arg = history_arg_extract (count, count, entry->line); | |||
644 | if (!arg || !*arg) | |||
645 | { | |||
646 | ding (); | |||
647 | - return; | |||
648 | + return 0; | |||
649 | } | |||
650 | ||||
651 | rl_begin_undo_group (); | |||
652 | @@ -5065,6 +5095,7 @@ rl_yank_nth_arg (count, ignore) | |||
653 | free (arg); | |||
654 | ||||
655 | rl_end_undo_group (); | |||
656 | + return 0; | |||
657 | } | |||
658 | ||||
659 | /* How to toggle back and forth between editing modes. */ | |||
660 | @@ -5417,9 +5448,10 @@ rl_macro_bind (keyseq, macro, map) | |||
661 | if (rl_translate_keyseq (macro, macro_keys, ¯o_keys_len)) | |||
662 | { | |||
663 | free (macro_keys); | |||
664 | - return; | |||
665 | + return 0; | |||
666 | } | |||
667 | rl_generic_bind (ISMACR, keyseq, macro_keys, map); | |||
668 | + return 0; | |||
669 | } | |||
670 | ||||
671 | /* Bind the key sequence represented by the string KEYSEQ to | |||
672 | @@ -5441,7 +5473,7 @@ rl_generic_bind (type, keyseq, data, map | |||
673 | { | |||
674 | if (type == ISMACR) | |||
675 | free (data); | |||
676 | - return; | |||
677 | + return 0; | |||
678 | } | |||
679 | ||||
680 | keys = (char *)alloca (1 + (2 * strlen (keyseq))); | |||
681 | @@ -5450,7 +5482,7 @@ rl_generic_bind (type, keyseq, data, map | |||
682 | of characters. Stuff the characters into ARRAY, and the | |||
683 | length of ARRAY into LENGTH. */ | |||
684 | if (rl_translate_keyseq (keyseq, keys, &keys_len)) | |||
685 | - return; | |||
686 | + return 0; | |||
687 | ||||
688 | /* Bind keys, making new keymaps as necessary. */ | |||
689 | for (i = 0; i < keys_len; i++) | |||
690 | @@ -5476,6 +5508,7 @@ rl_generic_bind (type, keyseq, data, map | |||
691 | map[keys[i]].type = type; | |||
692 | } | |||
693 | } | |||
694 | + return 0; | |||
695 | } | |||
696 | ||||
697 | /* Translate the ASCII representation of SEQ, stuffing the | |||
698 | @@ -5661,7 +5694,7 @@ parser_if (args) | |||
699 | /* If parsing is turned off, then nothing can turn it back on except | |||
700 | for finding the matching endif. In that case, return right now. */ | |||
701 | if (parsing_conditionalized_out) | |||
702 | - return; | |||
703 | + return 0; | |||
704 | ||||
705 | /* Isolate first argument. */ | |||
706 | for (i = 0; args[i] && !whitespace (args[i]); i++); | |||
707 | @@ -5713,6 +5746,7 @@ parser_if (args) | |||
708 | parsing_conditionalized_out = 0; | |||
709 | else | |||
710 | parsing_conditionalized_out = 1; | |||
711 | + return 0; | |||
712 | } | |||
713 | ||||
714 | /* Invert the current parser state if there is anything on the stack. */ | |||
715 | @@ -5724,17 +5758,18 @@ parser_else (args) | |||
716 | if (!if_stack_depth) | |||
717 | { | |||
718 | /* Error message? */ | |||
719 | - return; | |||
720 | + return 0; | |||
721 | } | |||
722 | ||||
723 | /* Check the previous (n - 1) levels of the stack to make sure that | |||
724 | we haven't previously turned off parsing. */ | |||
725 | for (i = 0; i < if_stack_depth - 1; i++) | |||
726 | if (if_stack[i] == 1) | |||
727 | - return; | |||
728 | + return 0; | |||
729 | ||||
730 | /* Invert the state of parsing if at top level. */ | |||
731 | parsing_conditionalized_out = !parsing_conditionalized_out; | |||
732 | + return 0; | |||
733 | } | |||
734 | ||||
735 | /* Terminate a conditional, popping the value of | |||
736 | @@ -5819,18 +5854,18 @@ rl_parse_and_bind (string) | |||
737 | string++; | |||
738 | ||||
739 | if (!string || !*string || *string == '#') | |||
740 | - return; | |||
741 | + return 0; | |||
742 | ||||
743 | /* If this is a parser directive, act on it. */ | |||
744 | if (*string == '$') | |||
745 | { | |||
746 | handle_parser_directive (&string[1]); | |||
747 | - return; | |||
748 | + return 0; | |||
749 | } | |||
750 | ||||
751 | /* If we are supposed to be skipping parsing right now, then do it. */ | |||
752 | if (parsing_conditionalized_out) | |||
753 | - return; | |||
754 | + return 0; | |||
755 | ||||
756 | i = 0; | |||
757 | /* If this keyname is a complex key expression surrounded by quotes, | |||
758 | @@ -5868,7 +5903,7 @@ rl_parse_and_bind (string) | |||
759 | while (*value && whitespace (*value)) value++; | |||
760 | ||||
761 | rl_variable_bind (var, value); | |||
762 | - return; | |||
763 | + return 0; | |||
764 | } | |||
765 | ||||
766 | /* Skip any whitespace between keyname and funname. */ | |||
767 | @@ -5928,7 +5963,7 @@ rl_parse_and_bind (string) | |||
768 | else | |||
769 | rl_set_key (seq, rl_named_function (funname), keymap); | |||
770 | ||||
771 | - return; | |||
772 | + return 0; | |||
773 | } | |||
774 | ||||
775 | /* Get the actual character we want to deal with. */ | |||
776 | @@ -5972,6 +6007,7 @@ rl_parse_and_bind (string) | |||
777 | #endif /* PREFIX_META_HACK */ | |||
778 | else | |||
779 | rl_bind_key (key, rl_named_function (funname)); | |||
780 | + return 0; | |||
781 | } | |||
782 | ||||
783 | rl_variable_bind (name, value) |
@@ -1,17 +1,17 @@ | @@ -1,17 +1,17 @@ | |||
1 | $NetBSD: patch-av,v 1.4 2012/02/16 14:13:15 hans Exp $ | 1 | $NetBSD: patch-av,v 1.5 2013/01/11 13:24:32 joerg Exp $ | |
2 | 2 | |||
3 | --- icb/unix.c.orig 1995-02-24 16:20:31.000000000 -0500 | 3 | --- icb/unix.c.orig 1995-02-24 21:20:31.000000000 +0000 | |
4 | +++ icb/unix.c 2009-07-23 21:22:34.000000000 -0400 | 4 | +++ icb/unix.c | |
5 | @@ -7,20 +7,27 @@ | 5 | @@ -7,20 +7,27 @@ | |
6 | #include <stdio.h> | 6 | #include <stdio.h> | |
7 | #include "icb.h" | 7 | #include "icb.h" | |
8 | #include "externs.h" | 8 | #include "externs.h" | |
9 | +#include <limits.h> | 9 | +#include <limits.h> | |
10 | #include <pwd.h> | 10 | #include <pwd.h> | |
11 | -#include <sys/dir.h> | 11 | -#include <sys/dir.h> | |
12 | +#include <time.h> | 12 | +#include <time.h> | |
13 | +#include <dirent.h> | 13 | +#include <dirent.h> | |
14 | 14 | |||
15 | #undef stty | 15 | #undef stty | |
16 | #undef gtty | 16 | #undef gtty | |
17 | 17 | |||
@@ -114,46 +114,64 @@ $NetBSD: patch-av,v 1.4 2012/02/16 14:13 | @@ -114,46 +114,64 @@ $NetBSD: patch-av,v 1.4 2012/02/16 14:13 | |||
114 | @@ -121,10 +132,10 @@ getterm() | 114 | @@ -121,10 +132,10 @@ getterm() | |
115 | ttyinfo.redraw = lt.t_rprntc; | 115 | ttyinfo.redraw = lt.t_rprntc; | |
116 | ttyinfo.werase = lt.t_werasc; | 116 | ttyinfo.werase = lt.t_werasc; | |
117 | } | 117 | } | |
118 | -#else /* SYSV */ | 118 | -#else /* SYSV */ | |
119 | +#else | 119 | +#else | |
120 | ttyinfo.redraw = '\022'; /* ^R */ | 120 | ttyinfo.redraw = '\022'; /* ^R */ | |
121 | ttyinfo.werase = '\027'; /* ^W */ | 121 | ttyinfo.werase = '\027'; /* ^W */ | |
122 | -#endif /* SYSV */ | 122 | -#endif /* SYSV */ | |
123 | +#endif | 123 | +#endif | |
124 | 124 | |||
125 | /* get the current window size */ | 125 | /* get the current window size */ | |
126 | getwinsize(); | 126 | getwinsize(); | |
127 | @@ -134,7 +145,7 @@ getterm() | |||
128 | ||||
129 | /* set up terminal modes optimal for icb */ | |||
130 | ||||
131 | -icbterm() | |||
132 | +void icbterm(void) | |||
133 | { | |||
134 | struct TTYSTRUCT tty; | |||
135 | ||||
127 | @@ -145,14 +156,14 @@ icbterm() | 136 | @@ -145,14 +156,14 @@ icbterm() | |
128 | bcopy((char *)&origtty, (char *)&tty, (unsigned)sizeof(struct TTYSTRUCT)); | 137 | bcopy((char *)&origtty, (char *)&tty, (unsigned)sizeof(struct TTYSTRUCT)); | |
129 | 138 | |||
130 | /* turn on cbreak - turn off echo */ | 139 | /* turn on cbreak - turn off echo */ | |
131 | -#ifndef SYSV | 140 | -#ifndef SYSV | |
132 | - tty.sg_flags |= CBREAK; | 141 | - tty.sg_flags |= CBREAK; | |
133 | - tty.sg_flags &= ~ECHO; | 142 | - tty.sg_flags &= ~ECHO; | |
134 | -#else /* SYSV */ | 143 | -#else /* SYSV */ | |
135 | +#if defined(TCSETA) || defined(TCSANOW) | 144 | +#if defined(TCSETA) || defined(TCSANOW) | |
136 | tty.c_lflag &= ~ICANON; | 145 | tty.c_lflag &= ~ICANON; | |
137 | tty.c_cc[VEOF] = 1; | 146 | tty.c_cc[VEOF] = 1; | |
138 | tty.c_lflag &= ~ECHO; | 147 | tty.c_lflag &= ~ECHO; | |
139 | -#endif /* SYSV */ | 148 | -#endif /* SYSV */ | |
140 | +#else | 149 | +#else | |
141 | + tty.sg_flags |= CBREAK; | 150 | + tty.sg_flags |= CBREAK; | |
142 | + tty.sg_flags &= ~ECHO; | 151 | + tty.sg_flags &= ~ECHO; | |
143 | +#endif | 152 | +#endif | |
144 | 153 | |||
145 | echomode = 0; | 154 | echomode = 0; | |
146 | /* set the new flags */ | 155 | /* set the new flags */ | |
156 | @@ -165,7 +176,7 @@ icbterm() | |||
157 | ||||
158 | /* restore term to original settings */ | |||
159 | ||||
160 | -restoreterm() | |||
161 | +void restoreterm(void) | |||
162 | { | |||
163 | if (badttyinfo) | |||
164 | return; | |||
147 | @@ -206,7 +217,11 @@ char *s; | 165 | @@ -206,7 +217,11 @@ char *s; | |
148 | struct passwd *pw; | 166 | struct passwd *pw; | |
149 | char login[17]; | 167 | char login[17]; | |
150 | char *p = login; | 168 | char *p = login; | |
151 | +#ifdef NAME_MAX | 169 | +#ifdef NAME_MAX | |
152 | + static char path[NAME_MAX + 1]; | 170 | + static char path[NAME_MAX + 1]; | |
153 | +#else | 171 | +#else | |
154 | static char path[MAXNAMLEN+1]; | 172 | static char path[MAXNAMLEN+1]; | |
155 | +#endif | 173 | +#endif | |
156 | 174 | |||
157 | /* has to start with a tilde */ | 175 | /* has to start with a tilde */ | |
158 | if (*s++ != '~') | 176 | if (*s++ != '~') | |
159 | @@ -258,11 +273,11 @@ echo() | 177 | @@ -258,11 +273,11 @@ echo() |
@@ -1,14 +1,23 @@ | @@ -1,14 +1,23 @@ | |||
1 | $NetBSD: patch-bq,v 1.4 2012/02/16 14:13:15 hans Exp $ | 1 | $NetBSD: patch-bq,v 1.5 2013/01/11 13:24:32 joerg Exp $ | |
2 | 2 | |||
3 | --- icb/main.c.orig 1995-02-24 16:20:24.000000000 -0500 | 3 | --- icb/main.c.orig 1995-02-24 21:20:24.000000000 +0000 | |
4 | +++ icb/main.c 2009-07-23 21:19:32.000000000 -0400 | 4 | +++ icb/main.c | |
5 | @@ -6,7 +6,8 @@ | 5 | @@ -6,7 +6,8 @@ | |
6 | #include "icb.h" | 6 | #include "icb.h" | |
7 | #include "externs.h" | 7 | #include "externs.h" | |
8 | #include <sys/wait.h> | 8 | #include <sys/wait.h> | |
9 | -#include <sys/dir.h> | 9 | -#include <sys/dir.h> | |
10 | +#include <dirent.h> | 10 | +#include <dirent.h> | |
11 | +#include <time.h> | 11 | +#include <time.h> | |
12 | #include "getswitch.h" | 12 | #include "getswitch.h" | |
13 | 13 | |||
14 | char *optv[] = { "clear", "list", "who", "restricted", "nickname:", "group:", | 14 | char *optv[] = { "clear", "list", "who", "restricted", "nickname:", "group:", | |
15 | @@ -225,7 +226,7 @@ char **argv; | |||
16 | tclinit(); | |||
17 | readlineinit(); | |||
18 | if (restrictflg && !gv.restricted) | |||
19 | - restrict(); | |||
20 | + restricted(); | |||
21 | } | |||
22 | ||||
23 | /* try to connect to port - if it fails, start server if we are on */ |
@@ -1,44 +1,44 @@ | @@ -1,44 +1,44 @@ | |||
1 | $NetBSD: patch-ar,v 1.2 2008/12/17 02:19:59 christos Exp $ | 1 | $NetBSD: patch-ar,v 1.3 2013/01/11 13:24:32 joerg Exp $ | |
2 | 2 | |||
3 | --- icb/serverlist.c.orig 1995-02-24 16:20:29.000000000 -0500 | 3 | --- icb/serverlist.c.orig 1995-02-24 21:20:29.000000000 +0000 | |
4 | +++ icb/serverlist.c 2008-12-16 20:18:00.000000000 -0500 | 4 | +++ icb/serverlist.c | |
5 | @@ -1,4 +1,6 @@ | 5 | @@ -1,4 +1,6 @@ | |
6 | #include <stdio.h> | 6 | #include <stdio.h> | |
7 | +#include <stdlib.h> | 7 | +#include <stdlib.h> | |
8 | +#include <pwd.h> | 8 | +#include <pwd.h> | |
9 | #include <sys/types.h> | 9 | #include <sys/types.h> | |
10 | #include <sys/stat.h> | 10 | #include <sys/stat.h> | |
11 | #include "icb.h" | 11 | #include "icb.h" | |
12 | @@ -14,15 +16,14 @@ | 12 | @@ -14,15 +16,14 @@ static FILE *serverfile = NULL; | |
13 | FILE *openserverfile() | 13 | FILE *openserverfile() | |
14 | { | 14 | { | |
15 | struct stat statbuf; | 15 | struct stat statbuf; | |
16 | - char *personalsl; | 16 | - char *personalsl; | |
17 | - char command[256]; | 17 | - char command[256]; | |
18 | - char pwd[256]; | 18 | - char pwd[256]; | |
19 | + char *personalsl, *home; | 19 | + char *personalsl, *home; | |
20 | + char pwd[MAXPATHLEN+1]; | 20 | + char pwd[MAXPATHLEN+1]; | |
21 | FILE *ret; | 21 | FILE *ret; | |
22 | 22 | |||
23 | #ifdef sgi | 23 | #ifdef sgi | |
24 | #undef SYSV | 24 | #undef SYSV | |
25 | #endif | 25 | #endif | |
26 | -#ifndef SYSV | 26 | -#ifndef SYSV | |
27 | +#if !defined(SYSV) && !(defined(BSD) && BSD >= 199306) && !defined(__linux__) | 27 | +#if !defined(SYSV) && !(defined(BSD) && BSD >= 199306) && !defined(__linux__) | |
28 | getwd(pwd); | 28 | getwd(pwd); | |
29 | #else /* SYSV */ | 29 | #else /* SYSV */ | |
30 | getcwd(pwd, MAXPATHLEN+1); | 30 | getcwd(pwd, MAXPATHLEN+1); | |
31 | @@ -30,11 +31,20 @@ | 31 | @@ -30,11 +31,20 @@ FILE *openserverfile() | |
32 | #ifdef sgi | 32 | #ifdef sgi | |
33 | #define SYSV | 33 | #define SYSV | |
34 | #endif | 34 | #endif | |
35 | - chdir(getenv("HOME")); | 35 | - chdir(getenv("HOME")); | |
36 | + if ((home = getenv("HOME")) == NULL) { | 36 | + if ((home = getenv("HOME")) == NULL) { | |
37 | + struct passwd *pw; | 37 | + struct passwd *pw; | |
38 | + if ((pw = getpwuid(getuid())) == NULL) | 38 | + if ((pw = getpwuid(getuid())) == NULL) | |
39 | + home = "."; | 39 | + home = "."; | |
40 | + home = pw->pw_dir; | 40 | + home = pw->pw_dir; | |
41 | + } | 41 | + } | |
42 | + chdir(home); | 42 | + chdir(home); | |
43 | if (!stat(PERSONALSL,&statbuf)) | 43 | if (!stat(PERSONALSL,&statbuf)) | |
44 | { | 44 | { |
@@ -1,28 +1,40 @@ | @@ -1,28 +1,40 @@ | |||
1 | $NetBSD: patch-bj,v 1.2 2008/12/17 02:19:59 christos Exp $ | 1 | $NetBSD: patch-bj,v 1.3 2013/01/11 13:24:32 joerg Exp $ | |
2 | 2 | |||
3 | --- readline/readline.h.orig 1995-02-24 16:20:03.000000000 -0500 | 3 | --- readline/readline.h.orig 1995-02-24 21:20:03.000000000 +0000 | |
4 | +++ readline/readline.h 2008-12-16 20:31:36.000000000 -0500 | 4 | +++ readline/readline.h | |
5 | @@ -5,11 +5,13 @@ | 5 | @@ -5,11 +5,13 @@ | |
6 | 6 | |||
7 | #include <readline/keymaps.h> | 7 | #include <readline/keymaps.h> | |
8 | #include <stdio.h> | 8 | #include <stdio.h> | |
9 | +#include <string.h> | 9 | +#include <string.h> | |
10 | 10 | |||
11 | #if !defined (__FUNCTION_DEF) | 11 | #if !defined (__FUNCTION_DEF) | |
12 | -typedef int Function (); | 12 | -typedef int Function (); | |
13 | +typedef int Function (const char *); | 13 | +typedef int Function (const char *); | |
14 | #define __FUNCTION_DEF | 14 | #define __FUNCTION_DEF | |
15 | #endif /* __FUNCTION_DEF */ | 15 | #endif /* __FUNCTION_DEF */ | |
16 | +typedef char **CPPFunction(const char *, int, int); | 16 | +typedef char **CPPFunction(const char *, int, int); | |
17 | 17 | |||
18 | /* The functions for manipulating the text of the line within readline. | 18 | /* The functions for manipulating the text of the line within readline. | |
19 | Most of these functions are bound to keys by default. */ | 19 | Most of these functions are bound to keys by default. */ | |
20 | @@ -141,7 +143,7 @@ | 20 | @@ -28,8 +30,9 @@ extern int | |
21 | rl_undo_command (), rl_revert_line (), rl_beginning_of_history (), | |||
22 | rl_end_of_history (), rl_forward_search_history (), rl_insert (), | |||
23 | rl_upcase_word (), rl_downcase_word (), rl_capitalize_word (), | |||
24 | - rl_restart_output (), rl_re_read_init_file (), rl_dump_functions (), | |||
25 | - rl_redisplay (); | |||
26 | + rl_restart_output (), rl_re_read_init_file (), rl_dump_functions (); | |||
27 | + | |||
28 | +extern void rl_redisplay (void); | |||
29 | ||||
30 | /* These are *both* defined even when VI_MODE is not. */ | |||
31 | extern int rl_vi_editing_mode (), rl_emacs_editing_mode (); | |||
32 | @@ -141,7 +144,7 @@ extern Function *rl_ignore_some_completi | |||
21 | If this function exists and returns NULL then call the value of | 33 | If this function exists and returns NULL then call the value of | |
22 | rl_completion_entry_function to try to match, otherwise use the | 34 | rl_completion_entry_function to try to match, otherwise use the | |
23 | array of strings returned. */ | 35 | array of strings returned. */ | |
24 | -extern Function *rl_attempted_completion_function; | 36 | -extern Function *rl_attempted_completion_function; | |
25 | +extern CPPFunction *rl_attempted_completion_function; | 37 | +extern CPPFunction *rl_attempted_completion_function; | |
26 | 38 | |||
27 | /* If non-zero, then this is the address of a function to call just | 39 | /* If non-zero, then this is the address of a function to call just | |
28 | before readline_internal () prints the first prompt. */ | 40 | before readline_internal () prints the first prompt. */ |
@@ -1,36 +1,40 @@ | @@ -1,36 +1,40 @@ | |||
1 | $NetBSD: patch-au,v 1.5 2012/02/16 14:13:15 hans Exp $ | 1 | $NetBSD: patch-au,v 1.6 2013/01/11 13:24:32 joerg Exp $ | |
2 | 2 | |||
3 | --- icb/tcl.c.orig 1995-02-24 16:20:30.000000000 -0500 | 3 | --- icb/tcl.c.orig 1995-02-24 21:20:30.000000000 +0000 | |
4 | +++ icb/tcl.c 2008-12-16 20:18:01.000000000 -0500 | 4 | +++ icb/tcl.c | |
5 | @@ -3,13 +3,14 @@ | 5 | @@ -3,13 +3,14 @@ | |
6 | 6 | |||
7 | /* TCL interface */ | 7 | /* TCL interface */ | |
8 | 8 | |||
9 | -#ifdef linux | 9 | -#ifdef linux | |
10 | +#include <limits.h> | 10 | +#include <limits.h> | |
11 | +#if defined(linux) || defined(__sun) | 11 | +#if defined(linux) || defined(__sun) | |
12 | #include <unistd.h> | 12 | #include <unistd.h> | |
13 | #endif | 13 | #endif | |
14 | 14 | |||
15 | #include "icb.h" | 15 | #include "icb.h" | |
16 | #include "externs.h" | 16 | #include "externs.h" | |
17 | -#include <sys/dir.h> | 17 | -#include <sys/dir.h> | |
18 | +#include <dirent.h> | 18 | +#include <dirent.h> | |
19 | #include <sys/file.h> | 19 | #include <sys/file.h> | |
20 | 20 | |||
21 | Tcl_Interp *interp; | 21 | Tcl_Interp *interp; | |
22 | @@ -95,7 +96,11 @@ tclinit() | 22 | @@ -92,10 +93,14 @@ tclinit() | |
23 | tclreadicbrc() | 23 | ||
24 | } | |||
25 | ||||
26 | -tclreadicbrc() | |||
27 | +void tclreadicbrc(void) | |||
24 | { | 28 | { | |
25 | char *p, *path; | 29 | char *p, *path; | |
26 | +#ifdef NAME_MAX | 30 | +#ifdef NAME_MAX | |
27 | + char cmd[NAME_MAX + 10]; | 31 | + char cmd[NAME_MAX + 10]; | |
28 | +#else | 32 | +#else | |
29 | char cmd[MAXNAMLEN+10]; | 33 | char cmd[MAXNAMLEN+10]; | |
30 | +#endif | 34 | +#endif | |
31 | 35 | |||
32 | if (!(path = getrcname())) return; | 36 | if (!(path = getrcname())) return; | |
33 | 37 | |||
34 | @@ -117,7 +122,11 @@ getrcname() | 38 | @@ -117,7 +122,11 @@ getrcname() | |
35 | { | 39 | { | |
36 | static char *names[] = { ".icbrc", ".fnrc", ".tclrc" , (char *)NULL }; | 40 | static char *names[] = { ".icbrc", ".fnrc", ".tclrc" , (char *)NULL }; |
@@ -1,13 +1,81 @@ | @@ -1,13 +1,81 @@ | |||
1 | $NetBSD: patch-br,v 1.1 2009/08/06 08:24:29 plunky Exp $ | 1 | $NetBSD: patch-br,v 1.2 2013/01/11 13:24:32 joerg Exp $ | |
2 | 2 | |||
3 | --- icb/getline.c.orig 2009-08-06 09:17:50.000000000 +0100 | 3 | --- icb/getline.c.orig 1995-02-24 21:20:22.000000000 +0000 | |
4 | +++ icb/getline.c | 4 | +++ icb/getline.c | |
5 | @@ -11,7 +11,7 @@ static char *line_read = (char *)NULL; | 5 | @@ -11,7 +11,7 @@ static char *line_read = (char *)NULL; | |
6 | 6 | |||
7 | extern void echo(); | 7 | extern void echo(); | |
8 | 8 | |||
9 | -char *getline(prompt, expand) | 9 | -char *getline(prompt, expand) | |
10 | +char *get_line(prompt, expand) | 10 | +char *get_line(prompt, expand) | |
11 | char *prompt; | 11 | char *prompt; | |
12 | int expand; | 12 | int expand; | |
13 | { | 13 | { | |
14 | @@ -45,9 +45,7 @@ int expand; | |||
15 | * keystroke handler for tab key | |||
16 | */ | |||
17 | int | |||
18 | -handletab(count, c) | |||
19 | -int count; | |||
20 | -char c; | |||
21 | +handletab(int count, int c) | |||
22 | { | |||
23 | char mpref[256]; | |||
24 | int ppoint; | |||
25 | @@ -62,7 +60,7 @@ char c; | |||
26 | /* make sure the history's not empty - punt if it is */ | |||
27 | if (histcount()==0) | |||
28 | { | |||
29 | - return; | |||
30 | + return 0; | |||
31 | } | |||
32 | ||||
33 | /* remember cursor location */ | |||
34 | @@ -86,7 +84,7 @@ char c; | |||
35 | } | |||
36 | else | |||
37 | printf("\007"); | |||
38 | - return; | |||
39 | + return 0; | |||
40 | } | |||
41 | ||||
42 | /* starts with command character */ | |||
43 | @@ -128,7 +126,7 @@ char c; | |||
44 | } | |||
45 | else | |||
46 | printf("\007"); | |||
47 | - return; | |||
48 | + return 0; | |||
49 | } | |||
50 | ||||
51 | /* case 4 - nickname completion */ | |||
52 | @@ -137,7 +135,7 @@ char c; | |||
53 | if (word2len > MAX_NICKLEN) | |||
54 | { | |||
55 | printf("\007"); | |||
56 | - return; | |||
57 | + return 0; | |||
58 | } | |||
59 | ||||
60 | if (rl_line_buffer[word2]=='@') | |||
61 | @@ -164,7 +162,7 @@ char c; | |||
62 | } | |||
63 | else | |||
64 | printf("\007"); | |||
65 | - return; | |||
66 | + return 0; | |||
67 | } | |||
68 | ||||
69 | /* case 5 - replace nickname */ | |||
70 | @@ -191,9 +189,10 @@ char c; | |||
71 | } | |||
72 | else | |||
73 | printf("\007"); | |||
74 | - return; | |||
75 | + return 0; | |||
76 | } | |||
77 | ||||
78 | /* anything else */ | |||
79 | printf("\007"); | |||
80 | + return 0; | |||
81 | } |
@@ -1,13 +1,34 @@ | @@ -1,13 +1,34 @@ | |||
1 | $NetBSD: patch-bt,v 1.1 2009/08/06 08:24:29 plunky Exp $ | 1 | $NetBSD: patch-bt,v 1.2 2013/01/11 13:24:32 joerg Exp $ | |
2 | 2 | |||
3 | --- icb/s_person.c.orig 2009-08-06 09:20:29.000000000 +0100 | 3 | --- icb/s_person.c.orig 1995-02-24 21:20:28.000000000 +0000 | |
4 | +++ icb/s_person.c | 4 | +++ icb/s_person.c | |
5 | @@ -106,7 +106,7 @@ int echoflag; | 5 | @@ -77,10 +77,7 @@ TARGDEFS | |
6 | } | |||
7 | ||||
8 | ||||
9 | -sendpersonal(nick, text, echoflag) | |||
10 | -char *nick; | |||
11 | -char *text; | |||
12 | -int echoflag; | |||
13 | +void sendpersonal(char *nick, char *text, int echoflag) | |||
14 | { | |||
15 | char *buf; | |||
16 | int pl_flags; | |||
17 | @@ -106,7 +103,7 @@ int echoflag; | |||
6 | { | 18 | { | |
7 | do | 19 | do | |
8 | { | 20 | { | |
9 | - text = getline(">> ",0); | 21 | - text = getline(">> ",0); | |
10 | + text = get_line(">> ",0); | 22 | + text = get_line(">> ",0); | |
11 | 23 | |||
12 | if (!text || (!*text && !last_command_was_kill)) | 24 | if (!text || (!*text && !last_command_was_kill)) | |
13 | { | 25 | { | |
26 | @@ -124,7 +121,7 @@ int echoflag; | |||
27 | if (!buf) | |||
28 | { | |||
29 | putl("[=Error=] No memory to build packet",PL_SCR); | |||
30 | - return 0; | |||
31 | + return; | |||
32 | } | |||
33 | ||||
34 | sprintf(buf,"%cm %s %s", gv.cmdchar, nick, text); |
$NetBSD: patch-icb_c__hush.c,v 1.1 2013/01/11 13:24:32 joerg Exp $
--- icb/c_hush.c.orig 2013-01-11 12:17:01.000000000 +0000
+++ icb/c_hush.c
@@ -71,7 +71,7 @@ char *nick;
return(0);
}
-hushlist()
+void hushlist(void)
{
STRLIST *p;
char *s, *t;
$NetBSD: patch-icb_c__replay.c,v 1.1 2013/01/11 13:24:32 joerg Exp $
--- icb/c_replay.c.orig 2013-01-11 12:18:00.000000000 +0000
+++ icb/c_replay.c
@@ -171,6 +171,8 @@ int lines;
putl("[=End of review buffer=]", pl_flags);
}
+static void bufparse(char *str);
+
int bufmatch(str)
{
bufparse(str);
@@ -182,8 +184,7 @@ if (personalflag == -1 && buftype == BUF
return 0;
return 1;
}
-bufparse(str)
-char *str;
+static void bufparse(char *str)
{
char cc;
$NetBSD: patch-icb_msgs.c,v 1.1 2013/01/11 13:24:32 joerg Exp $
--- icb/msgs.c.orig 1995-02-24 21:20:24.000000000 +0000
+++ icb/msgs.c
@@ -3,6 +3,7 @@
/* handle various messages from the server */
+#include <ctype.h>
#include <stdio.h>
#include "icb.h"
#include "externs.h"
@@ -17,8 +18,7 @@
/* open message */
-copenmsg(pkt)
-char *pkt;
+void copenmsg(char *pkt)
{
if (split(pkt) != 2) {
putl("[=Error=] got bad open message packet", PL_ALL);
@@ -38,8 +38,7 @@ char *pkt;
/* personal message */
-cpersonalmsg(pkt)
-char *pkt;
+void cpersonalmsg(char *pkt)
{
char string[256];
char host[256];
@@ -66,8 +65,7 @@ char *pkt;
/* beep message */
-beep(pkt)
-char *pkt;
+void beep(char *pkt)
{
char nick[MAX_NICKLEN+1];
@@ -110,8 +108,7 @@ exitmsg()
/* protocol version message */
-protomsg(pkt)
-char *pkt;
+void protomsg(char *pkt)
{
char *p;
int proto_level;
@@ -168,8 +165,7 @@ char *pkt;
/* system status update message */
-statusmsg(pkt)
-char *pkt;
+void statusmsg(char *pkt)
{
if (split(pkt) != 2) {
putl("[=Error=] got bad status message packet", PL_ALL);
@@ -329,8 +325,7 @@ char *pkt;
/* important system message */
-importantmsg(pkt)
-char *pkt;
+void importantmsg(char *pkt)
{
if (split(pkt) != 2) {
putl("[=Error=] got bad \"important\" message packet", PL_ALL);
$NetBSD: patch-icb_parse.c,v 1.1 2013/01/11 13:24:32 joerg Exp $
--- icb/parse.c.orig 2013-01-11 12:54:12.000000000 +0000
+++ icb/parse.c
@@ -12,8 +12,7 @@ char *nextword();
char *argv[10];
static char sbuf[1024];
-parse(s)
-char *s;
+void parse(char *s)
{
char cmdbuf[1024], *p;
int result;
$NetBSD: patch-readline_funmap.c,v 1.1 2013/01/11 13:24:32 joerg Exp $
--- readline/funmap.c.orig 2013-01-11 12:46:28.000000000 +0000
+++ readline/funmap.c
@@ -164,13 +164,14 @@ rl_initialize_funmap ()
register int i;
if (funmap_initialized)
- return;
+ return 0;
for (i = 0; default_funmap[i].name; i++)
rl_add_funmap_entry (default_funmap[i].name, default_funmap[i].function);
funmap_initialized = 1;
funmap_program_specific_entry_start = i;
+ return 0;
}
/* Stupid comparison routine for qsort () ing strings. */
$NetBSD: patch-readline_keymaps.c,v 1.1 2013/01/11 13:24:32 joerg Exp $
--- readline/keymaps.c.orig 2013-01-11 12:47:12.000000000 +0000
+++ readline/keymaps.c
@@ -110,7 +110,7 @@ rl_discard_keymap (map)
int i;
if (!map)
- return;
+ return 0;
for (i = 0; i < 128; i++)
{
@@ -128,6 +128,7 @@ rl_discard_keymap (map)
break;
}
}
+ return 0;
}
#ifdef STATIC_MALLOC
$NetBSD: patch-readline_vi__mode.c,v 1.1 2013/01/11 13:24:32 joerg Exp $
--- readline/vi_mode.c.orig 2013-01-11 12:42:57.000000000 +0000
+++ readline/vi_mode.c
@@ -172,7 +172,7 @@ rl_vi_search (count, key)
default:
ding ();
- return;
+ return 0;
}
vi_histpos = where_history ();
@@ -199,7 +199,7 @@ rl_vi_search (count, key)
maybe_unsave_line ();
rl_clear_message ();
rl_point = save_pos;
- return;
+ return 0;
}
case CTRL('W'):
@@ -218,7 +218,7 @@ rl_vi_search (count, key)
rl_clear_message ();
rl_point = 0;
ding ();
- return;
+ return 0;
default:
rl_insert (1, c);
@@ -232,6 +232,7 @@ rl_vi_search (count, key)
vi_last_search = savestring (rl_line_buffer);
rl_vi_dosearch (rl_line_buffer, dir);
+ return 0;
}
/* Search for STRING in the history list. DIR is < 0 for searching
@@ -274,7 +275,7 @@ rl_vi_dosearch (string, dir)
if (string == 0 || *string == 0 || vi_histpos < 0)
{
ding ();
- return;
+ return 0;
}
if ((save = vi_history_search_pos (string, dir, vi_histpos + dir)) == -1)
@@ -283,7 +284,7 @@ rl_vi_dosearch (string, dir)
rl_clear_message ();
rl_point = 0;
ding ();
- return;
+ return 0;
}
vi_histpos = save;
@@ -305,6 +306,7 @@ rl_vi_dosearch (string, dir)
rl_end = strlen (rl_line_buffer);
rl_point = 0;
rl_clear_message ();
+ return 0;
}
/* Completion, from vi's point of view. */
@@ -335,19 +337,20 @@ rl_vi_prev_word (count, key)
if (count < 0)
{
rl_vi_next_word (-count, key);
- return;
+ return 0;
}
if (rl_point == 0)
{
ding ();
- return;
+ return 0;
}
if (uppercase_p (key))
rl_vi_bWord (count);
else
rl_vi_bword (count);
+ return 0;
}
/* Next word in vi mode. */
@@ -357,19 +360,20 @@ rl_vi_next_word (count, key)
if (count < 0)
{
rl_vi_prev_word (-count, key);
- return;
+ return 0;
}
if (rl_point >= (rl_end - 1))
{
ding ();
- return;
+ return 0;
}
if (uppercase_p (key))
rl_vi_fWord (count);
else
rl_vi_fword (count);
+ return 0;
}
/* Move to the end of the ?next? word. */
@@ -379,13 +383,14 @@ rl_vi_end_word (count, key)
if (count < 0)
{
ding ();
- return;
+ return 0;
}
if (uppercase_p (key))
rl_vi_eWord (count);
else
rl_vi_eword (count);
+ return 0;
}
/* Move forward a word the way that 'W' does. */
@@ -610,7 +615,7 @@ rl_vi_change_case (count, ignore)
/* Don't try this on an empty line. */
if (rl_point >= rl_end)
- return;
+ return 0;
while (count-- && rl_point < rl_end)
{
@@ -631,6 +636,7 @@ rl_vi_change_case (count, ignore)
else
rl_forward (1);
}
+ return 0;
}
rl_vi_put (count, key)
@@ -779,13 +785,14 @@ rl_vi_delete_to (count, key)
if (rl_vi_domove (key, &c))
{
ding ();
- return;
+ return 0;
}
if ((c != 'l') && (c != '|') && (c != 'h') && rl_mark < rl_end)
rl_mark++;
rl_kill_text (rl_point, rl_mark);
+ return 0;
}
rl_vi_change_to (count, key)
@@ -799,7 +806,7 @@ rl_vi_change_to (count, key)
if (rl_vi_domove (key, &c))
{
ding ();
- return;
+ return 0;
}
if ((c != 'l') && (c != '|') && (c != 'h') && rl_mark < rl_end)
@@ -809,6 +816,7 @@ rl_vi_change_to (count, key)
vi_doing_insert = 1;
rl_kill_text (rl_point, rl_mark);
rl_vi_insertion_mode ();
+ return 0;
}
rl_vi_yank_to (count, key)
@@ -822,7 +830,7 @@ rl_vi_yank_to (count, key)
if (rl_vi_domove (key, &c))
{
ding ();
- return;
+ return 0;
}
if ((c != 'l') && (c != '|') && (c != 'h') && rl_mark < rl_end)
@@ -833,6 +841,7 @@ rl_vi_yank_to (count, key)
rl_end_undo_group ();
rl_do_undo ();
rl_point = save;
+ return 0;
}
rl_vi_delete (count)
@@ -842,7 +851,7 @@ rl_vi_delete (count)
if (rl_end == 0)
{
ding ();
- return;
+ return 0;
}
end = rl_point + count;
@@ -854,6 +863,7 @@ rl_vi_delete (count)
if (rl_point > 0 && rl_point == rl_end)
rl_backward (1);
+ return 0;
}
/* Turn the current line into a comment in shell history.
@@ -932,7 +942,7 @@ rl_vi_char_search (count, key)
if (pos == 0)
{
ding ();
- return;
+ return 0;
}
pos--;
@@ -952,7 +962,7 @@ rl_vi_char_search (count, key)
if (pos < 0)
{
ding ();
- return;
+ return 0;
}
}
else
@@ -960,7 +970,7 @@ rl_vi_char_search (count, key)
if (pos >= rl_end)
{
ding ();
- return;
+ return 0;
}
pos++;
@@ -980,10 +990,11 @@ rl_vi_char_search (count, key)
if (pos >= (rl_end - 1))
{
ding ();
- return;
+ return 0;
}
}
}
+ return 0;
}
/* Match brackets */
@@ -1002,7 +1013,7 @@ rl_vi_match ()
{
rl_point = pos;
ding ();
- return;
+ return 0;
}
}
@@ -1023,7 +1034,7 @@ rl_vi_match ()
else
{
ding ();
- return;
+ return 0;
}
}
}
@@ -1042,11 +1053,12 @@ rl_vi_match ()
else
{
ding ();
- return;
+ return 0;
}
}
}
rl_point = pos;
+ return 0;
}
int
@@ -1073,7 +1085,7 @@ rl_vi_change_char (count, key)
c = rl_getc (rl_instream);
if (c == '\033' || c == CTRL ('C'))
- return;
+ return 0;
while (count-- && rl_point < rl_end)
{
@@ -1086,6 +1098,7 @@ rl_vi_change_char (count, key)
rl_end_undo_group ();
}
+ return 0;
}
rl_vi_subst (count, key)