[BACK]Return to patch-ref.c CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / pkgsrc / editors / elvis / patches

File: [cvs.NetBSD.org] / pkgsrc / editors / elvis / patches / patch-ref.c (download)

Revision 1.2, Tue Dec 29 04:22:33 2015 UTC (4 years, 10 months ago) by dholland
Branch: MAIN
CVS Tags: pkgsrc-2020Q3-base, pkgsrc-2020Q3, pkgsrc-2020Q2-base, pkgsrc-2020Q2, pkgsrc-2020Q1-base, pkgsrc-2020Q1, pkgsrc-2019Q4-base, pkgsrc-2019Q4, pkgsrc-2019Q3-base, pkgsrc-2019Q3, pkgsrc-2019Q2-base, pkgsrc-2019Q2, pkgsrc-2019Q1-base, pkgsrc-2019Q1, pkgsrc-2018Q4-base, pkgsrc-2018Q4, pkgsrc-2018Q3-base, pkgsrc-2018Q3, pkgsrc-2018Q2-base, pkgsrc-2018Q2, pkgsrc-2018Q1-base, pkgsrc-2018Q1, pkgsrc-2017Q4-base, pkgsrc-2017Q4, pkgsrc-2017Q3-base, pkgsrc-2017Q3, pkgsrc-2017Q2-base, pkgsrc-2017Q2, pkgsrc-2017Q1-base, pkgsrc-2017Q1, pkgsrc-2016Q4-base, pkgsrc-2016Q4, pkgsrc-2016Q3-base, pkgsrc-2016Q3, pkgsrc-2016Q2-base, pkgsrc-2016Q2, pkgsrc-2016Q1-base, pkgsrc-2016Q1, HEAD
Changes since 1.1: +3 -1 lines

Add patch comments.

$NetBSD: patch-ref.c,v 1.2 2015/12/29 04:22:33 dholland Exp $

Fix symbol name conflict with posix getline().

--- ref.c.orig	2003-10-21 04:32:25.000000000 +0200
+++ ref.c
@@ -42,7 +42,7 @@ typedef enum
 
 #if USE_PROTOTYPES
 static void usage(char *argv0);
-static char *getline(FILE *fp);
+static char *_getline(FILE *fp);
 static void store(char *line, char **list);
 static LINECLS classify(char *line, LINECLS prev);
 static void lookup(TAG *tag);
@@ -171,7 +171,7 @@ ELVBOOL ioclose()
 /* This function reads a single line, and replaces the terminating newline with
  * a '\0' byte.  The string will be in a static buffer.  Returns NULL at EOF.
  */
-static char *getline(fp)
+static char *_getline(fp)
 	FILE	*fp;
 {
 	int	ch;
@@ -348,7 +348,7 @@ static void lookup(tag)
 	}
 
 	/* for each line... */
-	for (lnum = 1, lc = LC_COMPLETE; (line = getline(fp)) != NULL; lnum++)
+	for (lnum = 1, lc = LC_COMPLETE; (line = _getline(fp)) != NULL; lnum++)
 	{
 		/* is this the tag definition? */
 		if (taglnum > 0 ? taglnum == lnum : !strncmp(tagline, line, len))
@@ -377,7 +377,7 @@ static void lookup(tag)
 			{
 				if (strchr(line, '(') != NULL)
 				{
-					while ((line = getline(fp)) != NULL
+					while ((line = _getline(fp)) != NULL
 					    && *line
 					    && ((*line != '#' && *line != '{')
 						|| line[strlen(line) - 1] == '\\'))
@@ -387,7 +387,7 @@ static void lookup(tag)
 				}
 				else if ((lc = classify(line, lc)) == LC_PARTIAL)
 				{
-					while ((line = getline(fp)) != NULL
+					while ((line = _getline(fp)) != NULL
 					    && (lc = classify(line, lc)) == LC_PARTIAL)
 					{
 						puts(line);