getline -> get_line

This commit is contained in:
naddy 2012-03-17 23:01:09 +00:00
parent 9b5a025334
commit a2f2e0e316
2 changed files with 37 additions and 8 deletions

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.27 2011/12/02 14:36:14 espie Exp $
# $OpenBSD: Makefile,v 1.28 2012/03/17 23:01:09 naddy Exp $
COMMENT-canna= X input method for Japanese, canna support
COMMENT-canna-wnn= X input method for Japanese, canna and wnn support
@ -6,7 +6,7 @@ COMMENT-wnn= X input method for Japanese, wnn support
DISTNAME= kinput2-v3
PKGNAME= ja-kinput2-3.0
REVISION= 5
REVISION= 6
MASTER_SITES= ftp://ftp.sra.co.jp/pub/x11/kinput2/
CATEGORIES= japanese x11

View File

@ -1,7 +1,7 @@
$OpenBSD: patch-lib_cconv_c,v 1.1.1.1 2000/04/26 00:43:13 espie Exp $
--- lib/cconv.c.orig Thu May 27 01:55:25 1999
+++ lib/cconv.c Wed Apr 26 02:18:48 2000
@@ -611,7 +611,7 @@ static char *rcsid = "$Id: cconv.c,v 10.
$OpenBSD: patch-lib_cconv_c,v 1.2 2012/03/17 23:01:09 naddy Exp $
--- lib/cconv.c.orig Wed May 26 17:55:25 1999
+++ lib/cconv.c Sat Mar 17 16:58:01 2012
@@ -611,7 +611,7 @@ static char *rcsid = "$Id: cconv.c,v 10.8 1999/05/07 0
#define EPROC2(efunc, format, a) { \
char tmp[1024]; \
@ -10,6 +10,15 @@ $OpenBSD: patch-lib_cconv_c,v 1.1.1.1 2000/04/26 00:43:13 espie Exp $
eproc(efunc, tmp); }
/* $B%-!<%3!<%I$N%(%s%3!<%IJ}K!(B */
@@ -767,7 +767,7 @@ static wchar *promptsave(wchar *);
static int parseLine(uchar *, uchar **, int);
static FILE *openfile(char *);
static int doinclude(uchar *, Files *, void (*)());
-static uchar *getline(uchar *, int, Files *, void (*)());
+static uchar *get_line(uchar *, int, Files *, void (*)());
static int readRuleFile(ccRule, char *);
static int registMode(ccRule, int, uchar **);
static int newMode(ccRule, Files *, _strbufRec *, _funcbufRec *,
@@ -965,7 +965,7 @@ char *file;
if (q == filename) continue;
*q++ = '/';
@ -30,15 +39,35 @@ $OpenBSD: patch-lib_cconv_c,v 1.1.1.1 2000/04/26 00:43:13 espie Exp $
fp = fopen(filename, "r");
}
return fp;
@@ -1078,7 +1078,7 @@ char *file;
@@ -1013,7 +1013,7 @@ void (*efunc)();
}
/* getline -- 1$B9TFI$_9~$`(B ($B$=$N:](B include $B$N=hM}$r9T$J$&(B) */
-static uchar *getline(line, linesize, files, efunc)
+static uchar *get_line(line, linesize, files, efunc)
uchar *line;
int linesize;
Files *files;
@@ -1077,8 +1077,8 @@ char *file;
rule->nmode = 0;
rule->initialmode = -1;
while (getline(line, sizeof(line), &files, efunc)) {
- while (getline(line, sizeof(line), &files, efunc)) {
- (void)Strcpy(tmp, line);
+ while (get_line(line, sizeof(line), &files, efunc)) {
+ (void)strlcpy(tmp, line, sizeof(tmp));
if ((argc = parseLine(tmp, argv, 20)) == 0)
continue;
@@ -1246,7 +1246,7 @@ uchar **av;
cdbuf.cdbuf = NULL;
/* $B%k!<%k$rFI$s$G%9%H%"$9$k(B */
- while (getline(line, sizeof(line), files, efunc)) {
+ while (get_line(line, sizeof(line), files, efunc)) {
/* '#' $B$G;O$^$k9T$O%3%a%s%H(B */
if (*line == '\0' || *line == '\n' || *line == '#')
continue;
@@ -1302,7 +1302,7 @@ int *funcp;
"context" key "result" [function...]
*/