diff -Nru freebsd-libs-10.1~svn273304/debian/changelog freebsd-libs-10.1~svn273304/debian/changelog --- freebsd-libs-10.1~svn273304/debian/changelog 2014-10-21 09:24:29.000000000 +0000 +++ freebsd-libs-10.1~svn273304/debian/changelog 2016-03-23 15:55:36.000000000 +0000 @@ -1,3 +1,10 @@ +freebsd-libs (10.1~svn273304-1ubuntu1) xenial; urgency=medium + + * debian/patches/replace_fgetln.diff: Grab patch from Debian to replace + fgetln with getline and fix FTBFS on rebuild. + + -- Logan Rosen Wed, 23 Mar 2016 10:55:06 -0500 + freebsd-libs (10.1~svn273304-1) unstable; urgency=medium * New upstream snapshot of 10.1-RC3~ diff -Nru freebsd-libs-10.1~svn273304/debian/control freebsd-libs-10.1~svn273304/debian/control --- freebsd-libs-10.1~svn273304/debian/control 2014-10-20 11:13:44.000000000 +0000 +++ freebsd-libs-10.1~svn273304/debian/control 2016-03-23 15:55:39.000000000 +0000 @@ -1,7 +1,8 @@ Source: freebsd-libs Section: libs Priority: optional -Maintainer: GNU/kFreeBSD Maintainers +Maintainer: Ubuntu Developers +XSBC-Original-Maintainer: GNU/kFreeBSD Maintainers Uploaders: Aurelien Jarno , Robert Millan , Christoph Egger diff -Nru freebsd-libs-10.1~svn273304/debian/patches/replace_fgetln.diff freebsd-libs-10.1~svn273304/debian/patches/replace_fgetln.diff --- freebsd-libs-10.1~svn273304/debian/patches/replace_fgetln.diff 1970-01-01 00:00:00.000000000 +0000 +++ freebsd-libs-10.1~svn273304/debian/patches/replace_fgetln.diff 2016-03-23 15:54:39.000000000 +0000 @@ -0,0 +1,69 @@ +Subject: fparseln: replace fgetln(3) with getline(3) +From: Steven Chamberlain +Date: Sat, 05 Mar 2016 22:04:24 +0000 + +fgetln(3) is available in FreeBSD's libc but not GNU libc. Use the more +portable getline(3). This returns a malloc()'d buffer, rather than a +pointer to a (unterminated) C string, so remember to free it. + +fparseln(3) returns a different malloc()'d buffer, which the caller is +supposed to free(), so remember to actually do that in the test program. + +--- a/lib/libutil/fparseln.c ++++ b/lib/libutil/fparseln.c +@@ -80,7 +80,7 @@ + { + static const char dstr[3] = { '\\', '\\', '#' }; + +- size_t s, len; ++ ssize_t s, ibuflen, len; + char *buf; + char *ptr, *cp; + int cnt; +@@ -90,7 +90,9 @@ + _DIAGASSERT(fp != NULL); + #endif + ++ ibuflen = 0; + len = 0; ++ ptr = NULL; + buf = NULL; + cnt = 1; + +@@ -112,7 +114,7 @@ + if (lineno) + (*lineno)++; + +- if ((ptr = fgetln(fp, &s)) == NULL) ++ if ((s = getline(&ptr, &ibuflen, fp)) < 0) + break; + + if (s && com) { /* Check and eliminate comments */ +@@ -151,6 +153,7 @@ + + if ((cp = realloc(buf, len + s + 1)) == NULL) { + free(buf); ++ free(ptr); + return NULL; + } + buf = cp; +@@ -159,6 +162,7 @@ + len += s; + buf[len] = '\0'; + } ++ free(ptr); + + if ((flags & FPARSELN_UNESCALL) != 0 && esc && buf != NULL && + strchr(buf, esc) != NULL) { +@@ -206,8 +210,10 @@ + + line = 0; + while ((ptr = fparseln(stdin, &size, &line, NULL, +- FPARSELN_UNESCALL)) != NULL) ++ FPARSELN_UNESCALL)) != NULL) { + printf("line %d (%d) |%s|\n", line, size, ptr); ++ free(ptr); ++ } + return 0; + } + diff -Nru freebsd-libs-10.1~svn273304/debian/patches/series freebsd-libs-10.1~svn273304/debian/patches/series --- freebsd-libs-10.1~svn273304/debian/patches/series 2014-10-05 12:55:39.000000000 +0000 +++ freebsd-libs-10.1~svn273304/debian/patches/series 2016-03-23 15:55:02.000000000 +0000 @@ -29,3 +29,4 @@ libdwarf_off64_t.diff makefiles.diff pty_decls.diff +replace_fgetln.diff