[uim-commit] r1477 - branches/r5rs/sigscheme

kzk at freedesktop.org kzk at freedesktop.org
Sun Sep 11 16:42:38 PDT 2005


Author: kzk
Date: 2005-09-11 16:42:35 -0700 (Sun, 11 Sep 2005)
New Revision: 1477

Modified:
   branches/r5rs/sigscheme/debug.c
   branches/r5rs/sigscheme/operations.c
   branches/r5rs/sigscheme/read.c
Log:
* fix backslash handling

* sigscheme/read.c
  - (read_string): handle "\\" case
* sigscheme/operations.c
  - (ScmOp_list2string): not to add "\" when "\" appears
* sigscheme/debug.c
  - (print_string): write "\\" correctly


Modified: branches/r5rs/sigscheme/debug.c
===================================================================
--- branches/r5rs/sigscheme/debug.c	2005-09-11 23:28:18 UTC (rev 1476)
+++ branches/r5rs/sigscheme/debug.c	2005-09-11 23:42:35 UTC (rev 1477)
@@ -271,6 +271,7 @@
             case '\r': fprintf(f, "\\r"); break;
             case '\f': fprintf(f, "\\f"); break;
             case '\t': fprintf(f, "\\t"); break;
+            case '\\': fprintf(f, "\\\\"); break;
             default:
                 fprintf(f, "%c", str[i]); break;
             }

Modified: branches/r5rs/sigscheme/operations.c
===================================================================
--- branches/r5rs/sigscheme/operations.c	2005-09-11 23:28:18 UTC (rev 1476)
+++ branches/r5rs/sigscheme/operations.c	2005-09-11 23:42:35 UTC (rev 1477)
@@ -1651,10 +1651,6 @@
         ch  = SCM_CHAR_VALUE(obj);
         len = strlen(SCM_CHAR_VALUE(obj));
 
-        /* handle #\\ case */
-        if (len == 1 && ch[0] == '\\')
-            ch = "\\\\";
-
         strcpy(p, ch);
         p += len;
     }

Modified: branches/r5rs/sigscheme/read.c
===================================================================
--- branches/r5rs/sigscheme/read.c	2005-09-11 23:28:18 UTC (rev 1476)
+++ branches/r5rs/sigscheme/read.c	2005-09-11 23:42:35 UTC (rev 1477)
@@ -375,6 +375,7 @@
             case 'r':  stringbuf[stringlen] = '\r'; break;
             case 'f':  stringbuf[stringlen] = '\f'; break;
             case 't':  stringbuf[stringlen] = '\t'; break;
+            case '\\': stringbuf[stringlen] = '\\'; break;
             default:
                 stringbuf[stringlen] = '\\';
                 stringbuf[++stringlen] = c;



More information about the uim-commit mailing list