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
|
$NetBSD: patch-an,v 1.2 2010/04/15 06:50:46 dholland Exp $
Add necessary includes; fix POSIX getline lossage.
--- nls/gencat/genlib.c.orig 2005-08-18 12:49:24.000000000 +0000
+++ nls/gencat/genlib.c
@@ -42,6 +42,8 @@ up-to-date. Many thanks.
#include <stdio.h>
#include <sys/types.h>
#if defined(SYSV) || defined(__STDC__)
+# include <stdlib.h>
+# include <string.h>
# include <fcntl.h>
# include <unistd.h>
# define L_SET SEEK_SET
@@ -86,7 +88,7 @@ static void nomem() {
error(NULL, "out of memory");
}
-static char *getline(fd)
+static char *get_line(fd)
int fd;
{
static long len = 0, curlen = BUFSIZ;
@@ -201,7 +203,7 @@ char quote;
++cptr;
switch (*cptr) {
case '\0':
- cptr = getline(fd);
+ cptr = get_line(fd);
if (!cptr) error(NULL, "premature end of file");
msglen += strlen(cptr);
i = tptr - msg;
@@ -333,7 +335,7 @@ int fd;
hconst[0] = '\0';
- while (cptr = getline(fd)) {
+ while (cptr = get_line(fd)) {
if (*cptr == '$') {
++cptr;
if (strncmp(cptr, "set", 3) == 0) {
|