Deleted Added
full compact
fseek.c (71579) fseek.c (72529)
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

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

34 * SUCH DAMAGE.
35 */
36
37#if defined(LIBC_SCCS) && !defined(lint)
38#if 0
39static char sccsid[] = "@(#)fseek.c 8.3 (Berkeley) 1/2/94";
40#endif
41static const char rcsid[] =
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

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

34 * SUCH DAMAGE.
35 */
36
37#if defined(LIBC_SCCS) && !defined(lint)
38#if 0
39static char sccsid[] = "@(#)fseek.c 8.3 (Berkeley) 1/2/94";
40#endif
41static const char rcsid[] =
42 "$FreeBSD: head/lib/libc/stdio/fseek.c 71579 2001-01-24 13:01:12Z deischen $";
42 "$FreeBSD: head/lib/libc/stdio/fseek.c 72529 2001-02-16 06:11:22Z imp $";
43#endif /* LIBC_SCCS and not lint */
44
45#include "namespace.h"
46#include <sys/types.h>
47#include <sys/stat.h>
48#include <fcntl.h>
49#include <stdio.h>
50#include <stdlib.h>

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

199 /*
200 * Compute the number of bytes in the input buffer (pretending
201 * that any ungetc() input has been discarded). Adjust current
202 * offset backwards by this count so that it represents the
203 * file offset for the first byte in the current input buffer.
204 */
205 if (HASUB(fp)) {
206 curoff += fp->_r; /* kill off ungetc */
43#endif /* LIBC_SCCS and not lint */
44
45#include "namespace.h"
46#include <sys/types.h>
47#include <sys/stat.h>
48#include <fcntl.h>
49#include <stdio.h>
50#include <stdlib.h>

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

199 /*
200 * Compute the number of bytes in the input buffer (pretending
201 * that any ungetc() input has been discarded). Adjust current
202 * offset backwards by this count so that it represents the
203 * file offset for the first byte in the current input buffer.
204 */
205 if (HASUB(fp)) {
206 curoff += fp->_r; /* kill off ungetc */
207 n = fp->_up - fp->_bf._base;
207 n = fp->_extra->_up - fp->_bf._base;
208 curoff -= n;
209 n += fp->_ur;
210 } else {
211 n = fp->_p - fp->_bf._base;
212 curoff -= n;
213 n += fp->_r;
214 }
215

--- 60 unchanged lines hidden ---
208 curoff -= n;
209 n += fp->_ur;
210 } else {
211 n = fp->_p - fp->_bf._base;
212 curoff -= n;
213 n += fp->_r;
214 }
215

--- 60 unchanged lines hidden ---