[Prev][Next][Index]
unparse on \0.
- From: Rahul Singh <rsingh@valhalla.cs.wright.edu>
- Date: Mon, 3 Jun 1996 14:27:07 -0400
- To: sage-bugs@extreme.indiana.edu
- Subject: unparse on \0.
- Sender: owner-sage-bugs@extreme.indiana.edu
Unparse () does not print once it encounters a \0. The following patch posted in
1995 sage-bugs did not work for me.
Rahul
--------------------------------------------------------------------------------
> Looks like I've fixed this particular bug about a month ago. Try the following:
> 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