input.c (199647) | input.c (200956) |
---|---|
1/*- 2 * Copyright (c) 1991, 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 * Kenneth Almquist. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 22 unchanged lines hidden (view full) --- 31 */ 32 33#ifndef lint 34#if 0 35static char sccsid[] = "@(#)input.c 8.3 (Berkeley) 6/9/95"; 36#endif 37#endif /* not lint */ 38#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 1991, 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 * Kenneth Almquist. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 22 unchanged lines hidden (view full) --- 31 */ 32 33#ifndef lint 34#if 0 35static char sccsid[] = "@(#)input.c 8.3 (Berkeley) 6/9/95"; 36#endif 37#endif /* not lint */ 38#include <sys/cdefs.h> |
39__FBSDID("$FreeBSD: head/bin/sh/input.c 199647 2009-11-22 14:04:20Z jilles $"); | 39__FBSDID("$FreeBSD: head/bin/sh/input.c 200956 2009-12-24 18:41:14Z jilles $"); |
40 41#include <stdio.h> /* defines BUFSIZ */ 42#include <fcntl.h> 43#include <errno.h> 44#include <unistd.h> 45#include <stdlib.h> 46#include <string.h> 47 --- 348 unchanged lines hidden (view full) --- 396} 397 398/* 399 * Set the input to take input from a file. If push is set, push the 400 * old input onto the stack first. 401 */ 402 403void | 40 41#include <stdio.h> /* defines BUFSIZ */ 42#include <fcntl.h> 43#include <errno.h> 44#include <unistd.h> 45#include <stdlib.h> 46#include <string.h> 47 --- 348 unchanged lines hidden (view full) --- 396} 397 398/* 399 * Set the input to take input from a file. If push is set, push the 400 * old input onto the stack first. 401 */ 402 403void |
404setinputfile(char *fname, int push) | 404setinputfile(const char *fname, int push) |
405{ 406 int fd; 407 int fd2; 408 409 INTOFF; 410 if ((fd = open(fname, O_RDONLY)) < 0) 411 error("Can't open %s: %s", fname, strerror(errno)); 412 if (fd < 10) { --- 151 unchanged lines hidden --- | 405{ 406 int fd; 407 int fd2; 408 409 INTOFF; 410 if ((fd = open(fname, O_RDONLY)) < 0) 411 error("Can't open %s: %s", fname, strerror(errno)); 412 if (fd < 10) { --- 151 unchanged lines hidden --- |