/[emacs]/emacs/lib-src/yow.c
ViewVC logotype

Diff of /emacs/lib-src/yow.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.16 by fx, Tue Jan 21 18:29:11 2003 UTC revision 1.17 by lektu, Tue Feb 4 14:06:56 2003 UTC
# Line 1  Line 1 
1  /*  /*
2   * yow.c   * yow.c
3   *   *
4   * Print a quotation from Zippy the Pinhead.   * Print a quotation from Zippy the Pinhead.
5   * Qux <Kaufman-David@Yale> March 6, 1986   * Qux <Kaufman-David@Yale> March 6, 1986
6   *   *
7   * This file is in the public domain because the author published it   * This file is in the public domain because the author published it
8   * with no copyright notice before the US signed the Bern Convention.   * with no copyright notice before the US signed the Bern Convention.
9   *   *
10   * With dynamic memory allocation.   * With dynamic memory allocation.
11   */   */
12    
# Line 114  setup_yow(fp) Line 114  setup_yow(fp)
114    header_len = ftell(fp);    header_len = ftell(fp);
115    if (header_len > AVG_LEN)    if (header_len > AVG_LEN)
116      header_len -= AVG_LEN;      /* allow the first quotation to appear */      header_len -= AVG_LEN;      /* allow the first quotation to appear */
117            
118    if (fseek(fp, 0L, 2) == -1) {    if (fseek(fp, 0L, 2) == -1) {
119      perror("yow");      perror("yow");
120      exit(1);      exit(1);
# Line 167  yow (fp) Line 167  yow (fp)
167    buf[i++] = c;    buf[i++] = c;
168    while ((c = getc(fp)) != SEP && c != EOF) {    while ((c = getc(fp)) != SEP && c != EOF) {
169      buf[i++] = c;      buf[i++] = c;
170            
171      if (i == bufsize-1) {      if (i == bufsize-1) {
172        /* Yow! Is this quotation too long yet? */        /* Yow! Is this quotation too long yet? */
173        bufsize *= 2;        bufsize *= 2;

Legend:
Removed from v.1.16  
changed lines
  Added in v.1.17

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26