/[pspp]/pspp/src/ascii.c
ViewVC logotype

Diff of /pspp/src/ascii.c

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

revision 1.17 by blp, Sun Jul 31 21:42:46 2005 UTC revision 1.18 by blp, Tue Oct 25 04:28:17 2005 UTC
# Line 202  ascii_open_global (struct outp_class *th Line 202  ascii_open_global (struct outp_class *th
202  }  }
203    
204    
205  static unsigned char *s=0;  static char *s;
206  static int  static int
207  ascii_close_global (struct outp_class *this UNUSED)  ascii_close_global (struct outp_class *this UNUSED)
208  {  {
# Line 1158  text_draw (struct outp_driver *this, str Line 1158  text_draw (struct outp_driver *this, str
1158  /* ascii_close_page () and support routines. */  /* ascii_close_page () and support routines. */
1159    
1160  #define LINE_BUF_SIZE 1024  #define LINE_BUF_SIZE 1024
1161  static unsigned char *line_buf;  static char *line_buf;
1162  static unsigned char *line_p;  static char *line_p;
1163    
1164  static inline int  static inline int
1165  commit_line_buf (struct outp_driver *this)  commit_line_buf (struct outp_driver *this)
# Line 1312  output_shorts (struct outp_driver *this, Line 1312  output_shorts (struct outp_driver *this,
1312  /* Writes CH into line_buf N times, or to THIS->output if line_buf  /* Writes CH into line_buf N times, or to THIS->output if line_buf
1313     overflows. */     overflows. */
1314  static inline void  static inline void
1315  output_char (struct outp_driver *this, int n, int ch)  output_char (struct outp_driver *this, int n, char ch)
1316  {  {
1317    if (LINE_BUF_SIZE - (line_p - line_buf) >= n)    if (LINE_BUF_SIZE - (line_p - line_buf) >= n)
1318      {      {
# Line 1474  output_lines (struct outp_driver *this, Line 1474  output_lines (struct outp_driver *this,
1474          }          }
1475        if (n_passes > 1)        if (n_passes > 1)
1476          {          {
1477            unsigned char ch;            char ch;
1478    
1479            return_carriage (this, n_chars);            return_carriage (this, n_chars);
1480            n_chars = 0;            n_chars = 0;
# Line 1538  ascii_close_page (struct outp_driver *th Line 1538  ascii_close_page (struct outp_driver *th
1538    
1539    struct ascii_driver_ext *x = this->ext;    struct ascii_driver_ext *x = this->ext;
1540    int nl_len, ff_len, total_len;    int nl_len, ff_len, total_len;
1541    unsigned char *cp;    char *cp;
1542    int i;    int i;
1543    
1544    assert (this->driver_open && this->page_open);    assert (this->driver_open && this->page_open);
# Line 1624  ascii_close_page (struct outp_driver *th Line 1624  ascii_close_page (struct outp_driver *th
1624            output_string (this, s, &s[total_len]);            output_string (this, s, &s[total_len]);
1625    
1626    if (line_p != line_buf && !commit_line_buf (this))    if (line_p != line_buf && !commit_line_buf (this))
     {  
     free(s);  
     s=0;  
1627      return 0;      return 0;
     }  
1628    
1629    this->page_open = 0;    this->page_open = 0;
1630    return 1;    return 1;

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

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