root/src/noitedit/fgetln.c

Revision 2c4eb5b5fbb052c18d52a989026b447982cc17c3, 295 bytes (checked in by Theo Schlossnagle <jesus@omniti.com>, 6 years ago)

pull header-space into the noitedir dir, this makes it stand apart from libedit more trivially.

  • Property mode set to 100644
Line 
1 #include "noit_defines.h"
2
3 #include <stdio.h>
4 #include "noitedit/compat.h"
5
6 #ifndef HAVE_FGETLN
7 char *fgetln(FILE *stream, size_t *len)
8 {
9   char buf[8192];
10   if (buf == fgets(buf, sizeof(buf), stream)) {
11     char *ptr = strdup(buf);
12         *len = strlen(ptr);
13         return ptr;
14   }
15   return NULL;
16 }
17 #endif
Note: See TracBrowser for help on using the browser.