mirror of
https://github.com/Stichting-MINIX-Research-Foundation/pkgsrc-ng.git
synced 2025-09-08 03:44:13 -04:00
43 lines
1.0 KiB
Plaintext
43 lines
1.0 KiB
Plaintext
$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) {
|