rs.c (132205) | rs.c (145617) |
---|---|
1/*- 2 * Copyright (c) 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 34 unchanged lines hidden (view full) --- 43 44/* 45 * rs - reshape a data array 46 * Author: John Kunze, Office of Comp. Affairs, UCB 47 * BEWARE: lots of unfinished edges 48 */ 49 50#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 34 unchanged lines hidden (view full) --- 43 44/* 45 * rs - reshape a data array 46 * Author: John Kunze, Office of Comp. Affairs, UCB 47 * BEWARE: lots of unfinished edges 48 */ 49 50#include <sys/cdefs.h> |
51__FBSDID("$FreeBSD: head/usr.bin/rs/rs.c 132205 2004-07-15 10:26:38Z tjr $"); | 51__FBSDID("$FreeBSD: head/usr.bin/rs/rs.c 145617 2005-04-28 12:37:15Z robert $"); |
52 53#include <err.h> 54#include <ctype.h> 55#include <stdio.h> 56#include <stdlib.h> 57#include <string.h> 58 59long flags; --- 21 unchanged lines hidden (view full) --- 81short *ocbd; 82int nelem; 83char **elem; 84char **endelem; 85char *curline; 86int allocsize = BUFSIZ; 87int curlen; 88int irows, icols; | 52 53#include <err.h> 54#include <ctype.h> 55#include <stdio.h> 56#include <stdlib.h> 57#include <string.h> 58 59long flags; --- 21 unchanged lines hidden (view full) --- 81short *ocbd; 82int nelem; 83char **elem; 84char **endelem; 85char *curline; 86int allocsize = BUFSIZ; 87int curlen; 88int irows, icols; |
89int orows, ocols; | 89int orows = 0, ocols = 0; |
90int maxlen; 91int skip; 92int propgutter; 93char isep = ' ', osep = ' '; 94char blank[] = ""; 95int owidth = 80, gutter = 2; 96 97void getargs(int, char *[]); --- 379 unchanged lines hidden (view full) --- 477 usage(); 478 } 479 /*if (!osep) 480 osep = isep;*/ 481 switch (ac) { 482 /*case 3: 483 opages = atoi(av[2]);*/ 484 case 2: | 90int maxlen; 91int skip; 92int propgutter; 93char isep = ' ', osep = ' '; 94char blank[] = ""; 95int owidth = 80, gutter = 2; 96 97void getargs(int, char *[]); --- 379 unchanged lines hidden (view full) --- 477 usage(); 478 } 479 /*if (!osep) 480 osep = isep;*/ 481 switch (ac) { 482 /*case 3: 483 opages = atoi(av[2]);*/ 484 case 2: |
485 ocols = atoi(av[1]); | 485 if ((ocols = atoi(av[1])) < 0) 486 ocols = 0; |
486 case 1: | 487 case 1: |
487 orows = atoi(av[0]); | 488 if ((orows = atoi(av[0])) < 0) 489 orows = 0; |
488 case 0: 489 break; 490 default: 491 errx(1, "too many arguments"); 492 } 493} 494 495char * --- 52 unchanged lines hidden --- | 490 case 0: 491 break; 492 default: 493 errx(1, "too many arguments"); 494 } 495} 496 497char * --- 52 unchanged lines hidden --- |