[Prev][Next][Index]
Re: Another bug
- From: "Beata Winnicka" <bfatyga@slab.cica.indiana.edu>
- Date: Mon, 16 Jan 95 16:54:36 -0500
- To: Michael Golden <mgolden@eecs.umich.edu>
- Subject: Re: Another bug
- Cc: sage-bugs@cica.indiana.edu
>When I parse and unparse the following program, the unparser stops
>at the null character '\0'.
Michael,
thanks a lot for the bug report.
Here's a fix. Find the following code in lib/newsrc/unparse.c:
if (strncmp(&(str[i]),"CHARVAL", strlen("CHARVAL"))== 0)
/* %CHARVAL : Char Value */
{
switch(NODE_CV(ll)){
case '\n':BufPutChar('\\'); BufPutChar('n');
break;
case '\t':BufPutChar('\\'); BufPutChar('t');
break;
(This is around line 2043 in the version we have)
and add the following cases to the switch statement:
case '\0':BufPutChar('\\'); BufPutChar('0'); break;
case '\'':BufPutChar('\\'); BufPutChar('\''); break;
case '\"':BufPutChar('\\'); BufPutChar('\"'); break;
case '\\':BufPutChar('\\'); BufPutChar('\\'); break;
--Beata