summary |
tags |
clone url |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
c9129d7)
SCCS-vsn: usr.bin/rs/rs.c 4.2
/* Copyright (c) 1983 Regents of the University of California */
#ifndef lint
/* Copyright (c) 1983 Regents of the University of California */
#ifndef lint
-static char sccsid[] = "@(#)rs.c 4.1 (Berkeley) %G%";
+static char sccsid[] = "@(#)rs.c 4.2 (Berkeley) %G%";
#define ICOLBOUNDS 020000
#define OCOLBOUNDS 040000
#define ONEPERCHAR 0100000
#define ICOLBOUNDS 020000
#define OCOLBOUNDS 040000
#define ONEPERCHAR 0100000
char buf[BUFSIZ];
short *colwidths;
char buf[BUFSIZ];
short *colwidths;
puts(curline);
}
getline();
puts(curline);
}
getline();
+ if (flags & NOARGS && curlen < owidth)
+ flags |= ONEPERLINE;
if (flags & ONEPERLINE)
icols = 1;
else /* count cols on first line */
if (flags & ONEPERLINE)
icols = 1;
else /* count cols on first line */
ocols = irows;
}
else if (orows == 0 && ocols == 0) { /* decide rows and cols */
ocols = irows;
}
else if (orows == 0 && ocols == 0) { /* decide rows and cols */
- ocols = owidth / colw; /* not a good idea */
+ ocols = owidth / colw;
+ if (ocols == 0)
+ fprintf(stderr, "Display width %d is less than column width %d\n", owidth, colw);
if (ocols > nelem)
ocols = nelem;
orows = nelem / ocols + (nelem % ocols ? 1 : 0);
if (ocols > nelem)
ocols = nelem;
orows = nelem / ocols + (nelem % ocols ? 1 : 0);
char *getnum(), *getlist();
if (ac == 1) {
char *getnum(), *getlist();
if (ac == 1) {
- flags |= ONEPERLINE | TRANSPOSE;
+ flags |= NOARGS | TRANSPOSE;
}
while (--ac && **++av == '-')
for (p = *av+1; *p; p++)
}
while (--ac && **++av == '-')
for (p = *av+1; *p; p++)