Deleted Added
full compact
fgetln.c (165903) fgetln.c (249381)
1/*-
2 * Copyright (c) 1990, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * Chris Torek.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 20 unchanged lines hidden (view full) ---

29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * SUCH DAMAGE.
31 */
32
33#if defined(LIBC_SCCS) && !defined(lint)
34static char sccsid[] = "@(#)fgetln.c 8.2 (Berkeley) 1/2/94";
35#endif /* LIBC_SCCS and not lint */
36#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 1990, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * Chris Torek.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 20 unchanged lines hidden (view full) ---

29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * SUCH DAMAGE.
31 */
32
33#if defined(LIBC_SCCS) && !defined(lint)
34static char sccsid[] = "@(#)fgetln.c 8.2 (Berkeley) 1/2/94";
35#endif /* LIBC_SCCS and not lint */
36#include <sys/cdefs.h>
37__FBSDID("$FreeBSD: head/lib/libc/stdio/fgetln.c 165903 2007-01-09 00:28:16Z imp $");
37__FBSDID("$FreeBSD: head/lib/libc/stdio/fgetln.c 249381 2013-04-11 20:15:37Z emaste $");
38
39#include "namespace.h"
40#include <stdio.h>
41#include <stdlib.h>
42#include <string.h>
43#include "un-namespace.h"
44#include "libc_private.h"
45#include "local.h"

--- 64 unchanged lines hidden (view full) ---

110 return (ret);
111 }
112
113 /*
114 * We have to copy the current buffered data to the line buffer.
115 * As a bonus, though, we can leave off the __SMOD.
116 *
117 * OPTIMISTIC is length that we (optimistically) expect will
38
39#include "namespace.h"
40#include <stdio.h>
41#include <stdlib.h>
42#include <string.h>
43#include "un-namespace.h"
44#include "libc_private.h"
45#include "local.h"

--- 64 unchanged lines hidden (view full) ---

110 return (ret);
111 }
112
113 /*
114 * We have to copy the current buffered data to the line buffer.
115 * As a bonus, though, we can leave off the __SMOD.
116 *
117 * OPTIMISTIC is length that we (optimistically) expect will
118 * accomodate the `rest' of the string, on each trip through the
118 * accommodate the `rest' of the string, on each trip through the
119 * loop below.
120 */
121#define OPTIMISTIC 80
122
123 for (len = fp->_r, off = 0;; len += fp->_r) {
124 size_t diff;
125
126 /*

--- 38 unchanged lines hidden ---
119 * loop below.
120 */
121#define OPTIMISTIC 80
122
123 for (len = fp->_r, off = 0;; len += fp->_r) {
124 size_t diff;
125
126 /*

--- 38 unchanged lines hidden ---