dc.c (302408) | dc.c (315134) |
---|---|
1/* $OpenBSD: dc.c,v 1.11 2009/10/27 23:59:37 deraadt Exp $ */ 2 3/* 4 * Copyright (c) 2003, Otto Moerbeek <otto@drijf.net> 5 * Copyright (c) 2009, Gabor Kovesdan <gabor@FreeBSD.org> 6 * 7 * Permission to use, copy, modify, and distribute this software for any 8 * purpose with or without fee is hereby granted, provided that the above --- 4 unchanged lines hidden (view full) --- 13 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 14 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 15 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 16 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 17 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 18 */ 19 20#include <sys/cdefs.h> | 1/* $OpenBSD: dc.c,v 1.11 2009/10/27 23:59:37 deraadt Exp $ */ 2 3/* 4 * Copyright (c) 2003, Otto Moerbeek <otto@drijf.net> 5 * Copyright (c) 2009, Gabor Kovesdan <gabor@FreeBSD.org> 6 * 7 * Permission to use, copy, modify, and distribute this software for any 8 * purpose with or without fee is hereby granted, provided that the above --- 4 unchanged lines hidden (view full) --- 13 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 14 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 15 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 16 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 17 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 18 */ 19 20#include <sys/cdefs.h> |
21__FBSDID("$FreeBSD: stable/11/usr.bin/dc/dc.c 247441 2013-02-28 01:22:14Z gjb $"); | 21__FBSDID("$FreeBSD: stable/11/usr.bin/dc/dc.c 315134 2017-03-12 05:35:28Z pfg $"); |
22 23#include <sys/stat.h> 24 25#include <ctype.h> 26#include <err.h> 27#include <errno.h> 28#include <getopt.h> 29#include <stdio.h> --- 85 unchanged lines hidden (view full) --- 115 usage(); 116 } 117 } 118 argc -= optind; 119 argv += optind; 120 121 if (!preproc_done) 122 init_bmachine(extended_regs); | 22 23#include <sys/stat.h> 24 25#include <ctype.h> 26#include <err.h> 27#include <errno.h> 28#include <getopt.h> 29#include <stdio.h> --- 85 unchanged lines hidden (view full) --- 115 usage(); 116 } 117 } 118 argc -= optind; 119 argv += optind; 120 121 if (!preproc_done) 122 init_bmachine(extended_regs); |
123 setlinebuf(stdout); 124 setlinebuf(stderr); | 123 (void)setvbuf(stdout, NULL, _IOLBF, 0); 124 (void)setvbuf(stderr, NULL, _IOLBF, 0); |
125 126 if (argc > 1) 127 usage(); 128 if (argc == 1) { 129 procfile(argv[0]); 130 preproc_done = true; 131 } 132 if (preproc_done) 133 return (0); 134 135 src_setstream(&src, stdin); 136 reset_bmachine(&src); 137 eval(); 138 139 return (0); 140} | 125 126 if (argc > 1) 127 usage(); 128 if (argc == 1) { 129 procfile(argv[0]); 130 preproc_done = true; 131 } 132 if (preproc_done) 133 return (0); 134 135 src_setstream(&src, stdin); 136 reset_bmachine(&src); 137 eval(); 138 139 return (0); 140} |