patch-ref_c 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. $OpenBSD: patch-ref_c,v 1.1 2012/03/17 12:40:01 sthen Exp $
  2. --- ref.c.orig Tue Oct 21 04:32:25 2003
  3. +++ ref.c Sat Mar 17 12:28:41 2012
  4. @@ -42,7 +42,7 @@ typedef enum
  5. #if USE_PROTOTYPES
  6. static void usage(char *argv0);
  7. -static char *getline(FILE *fp);
  8. +static char *get_line(FILE *fp);
  9. static void store(char *line, char **list);
  10. static LINECLS classify(char *line, LINECLS prev);
  11. static void lookup(TAG *tag);
  12. @@ -171,7 +171,7 @@ ELVBOOL ioclose()
  13. /* This function reads a single line, and replaces the terminating newline with
  14. * a '\0' byte. The string will be in a static buffer. Returns NULL at EOF.
  15. */
  16. -static char *getline(fp)
  17. +static char *get_line(fp)
  18. FILE *fp;
  19. {
  20. int ch;
  21. @@ -348,7 +348,7 @@ static void lookup(tag)
  22. }
  23. /* for each line... */
  24. - for (lnum = 1, lc = LC_COMPLETE; (line = getline(fp)) != NULL; lnum++)
  25. + for (lnum = 1, lc = LC_COMPLETE; (line = get_line(fp)) != NULL; lnum++)
  26. {
  27. /* is this the tag definition? */
  28. if (taglnum > 0 ? taglnum == lnum : !strncmp(tagline, line, len))
  29. @@ -377,7 +377,7 @@ static void lookup(tag)
  30. {
  31. if (strchr(line, '(') != NULL)
  32. {
  33. - while ((line = getline(fp)) != NULL
  34. + while ((line = get_line(fp)) != NULL
  35. && *line
  36. && ((*line != '#' && *line != '{')
  37. || line[strlen(line) - 1] == '\\'))
  38. @@ -387,7 +387,7 @@ static void lookup(tag)
  39. }
  40. else if ((lc = classify(line, lc)) == LC_PARTIAL)
  41. {
  42. - while ((line = getline(fp)) != NULL
  43. + while ((line = get_line(fp)) != NULL
  44. && (lc = classify(line, lc)) == LC_PARTIAL)
  45. {
  46. puts(line);