fmt.c (63ffb113474aff32b0e8bad11d52b816655aa701) fmt.c (dc3001cf357baa1d3fca2f6e9b49c9b1e5919713)
1/*
2 * Copyright (c) 1980, 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

--- 28 unchanged lines hidden (view full) ---

37 The Regents of the University of California. All rights reserved.\n";
38#endif /* not lint */
39
40#ifndef lint
41#if 0
42static char sccsid[] = "@(#)fmt.c 8.1 (Berkeley) 7/20/93";
43#else
44static const char rcsid[] =
1/*
2 * Copyright (c) 1980, 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

--- 28 unchanged lines hidden (view full) ---

37 The Regents of the University of California. All rights reserved.\n";
38#endif /* not lint */
39
40#ifndef lint
41#if 0
42static char sccsid[] = "@(#)fmt.c 8.1 (Berkeley) 7/20/93";
43#else
44static const char rcsid[] =
45 "$Id$";
45 "$Id: fmt.c,v 1.9 1997/07/03 07:19:46 charnier Exp $";
46#endif
47#endif /* not lint */
48
49#include <ctype.h>
50#include <err.h>
51#include <locale.h>
52#include <stdio.h>
53#include <stdlib.h>

--- 103 unchanged lines hidden (view full) ---

157void
158fmt(fi)
159 FILE *fi;
160{
161 static char *linebuf = 0, *canonb = 0;
162 register char *cp, *cp2, cc;
163 register int c, col;
164#define CHUNKSIZE 1024
46#endif
47#endif /* not lint */
48
49#include <ctype.h>
50#include <err.h>
51#include <locale.h>
52#include <stdio.h>
53#include <stdlib.h>

--- 103 unchanged lines hidden (view full) ---

157void
158fmt(fi)
159 FILE *fi;
160{
161 static char *linebuf = 0, *canonb = 0;
162 register char *cp, *cp2, cc;
163 register int c, col;
164#define CHUNKSIZE 1024
165 static int lbufsize = 0, cbufsize = 0;
165 static int lbufsize = 0, cbufsize = CHUNKSIZE;
166
166
167 canonb = malloc(CHUNKSIZE);
168 if (canonb == 0)
169 abort();
170
167 if (center) {
168 linebuf = malloc(BUFSIZ);
169 while (1) {
170 cp = fgets(linebuf, BUFSIZ, fi);
171 if (!cp)
172 return;
173 while (*cp && isspace(*cp))
174 cp++;

--- 376 unchanged lines hidden ---
171 if (center) {
172 linebuf = malloc(BUFSIZ);
173 while (1) {
174 cp = fgets(linebuf, BUFSIZ, fi);
175 if (!cp)
176 return;
177 while (*cp && isspace(*cp))
178 cp++;

--- 376 unchanged lines hidden ---