# From: @(#)Makefile 8.1 (Berkeley) 6/6/93
-# $FreeBSD: src/usr.bin/cut/Makefile,v 1.2.6.1 2001/07/30 09:59:16 dd Exp $
-# $DragonFly: src/usr.bin/cut/Makefile,v 1.4 2007/08/27 16:50:52 pavalos Exp $
+# $FreeBSD: head/usr.bin/cut/Makefile 272783 2014-10-09 01:46:31Z ngie $
PROG= cut
*
* @(#) Copyright (c) 1989, 1993 The Regents of the University of California. All rights reserved.
* @(#)cut.c 8.3 (Berkeley) 5/4/95
- * $FreeBSD: src/usr.bin/cut/cut.c,v 1.33 2012/06/11 03:02:40 kevlo Exp $
+ * $FreeBSD: head/usr.bin/cut/cut.c 243474 2012-11-24 04:15:25Z andrew $
*/
#include <ctype.h>
static int c_cut(FILE *, const char *);
static int f_cut(FILE *, const char *);
static void get_list(char *);
-static int is_delim(int);
+static int is_delim(wchar_t);
static void needpos(size_t);
static void usage(void);
int ch, rval;
size_t n;
- setlocale (LC_ALL, "");
+ setlocale(LC_ALL, "");
fcn = NULL;
dchar = '\t'; /* default delimiter is \t */
if (bflag || cflag || nflag || (wflag && dflag))
usage();
} else if (!(bflag || cflag) || dflag || sflag || wflag)
- usage();
+ usage();
else if (!bflag && nflag)
usage();
rval = 1;
continue;
}
- fcn(fp, *argv);
- (void)fclose(fp);
- }
+ fcn(fp, *argv);
+ (void)fclose(fp);
+ }
}
else
rval = fcn(stdin, "stdin");
canwrite &= positions[1 + i];
if (canwrite)
fwrite(lbuf, 1, clen, stdout);
- } else {
+ } else {
/*
* Print the character if all of it has
* been selected.
break;
if (*pos++)
(void)putwchar(ch);
- }
+ }
if (ch != '\n') {
if (autostop)
while ((ch = getwc(fp)) != WEOF && ch != '\n')
}
static int
-is_delim(int ch)
+is_delim(wchar_t ch)
{
if (wflag) {
if (ch == ' ' || ch == '\t')
}
(void)putchar('\n');
}
- free(mlbuf);
+ free(mlbuf);
return (0);
}