<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> <HTML> <HEAD> <META NAME="GENERATOR" CONTENT="SGML-Tools 1.0.9"> <TITLE>Pilot HOWTO: $BLu<T$N>!<j$JIUO?(B</TITLE> <LINK HREF="Pilot-HOWTO-7.html" REL=next> <LINK HREF="Pilot-HOWTO-5.html" REL=previous> <LINK HREF="Pilot-HOWTO.html#toc6" REL=contents> </HEAD> <BODY> <A HREF="Pilot-HOWTO-7.html">$B<!$N%Z!<%8(B</A> <A HREF="Pilot-HOWTO-5.html">$BA0$N%Z!<%8(B</A> <A HREF="Pilot-HOWTO.html#toc6">$BL\<!$X(B</A> <HR> <H2><A NAME="s6">6. $BLu<T$N>!<j$JIUO?(B</A></H2> <P>pilot-link0.8.9 $B$N(B read-ical.c $B$GF|K\8l$rDL$9$?$a$N$$$$$+$2$s$J%Q%C%A(B $B0J2<$NFbMF$r(B 'diffs' $B$H$$$&%U%!%$%k$K%;!<%V$7$F!"(Bpilot-link0.8.9 $B$N(B $B%G%#%l%/%H%j$G(B (csh $B$^$?$O(B tcsh $B$+$i(B) <P> <BLOCKQUOTE><CODE> <PRE> patch <diffs |& tee patch.log </PRE> </CODE></BLOCKQUOTE> <P>$B$H<B9T$7$F$/$@$5$$!#(B $B$$$$$+$2$s$J$b$N$J$N$GF0:nJ]>Z$O$G$-$^$;$s$7!"(Bon your own risk $B$G(B $B9T$C$F$/$@$5$$!#(B ($B$=$b$=$b!"%*%j%8%J%k%=!<%9$G8@$&$H$3$m$N(B 0x95 - bullet $B$H$$$&$N$,(B $B2?<T$N$+$o$+$C$F$$$J$$>uBV$GL5M}LpM}(B SJIS $B$rDL$7$F$$$^$9$N$G!#(B) <P> <HR> <PRE> ==== cut here ==== cut here ==== cut here ==== cut here ==== *** read-ical.c-dist Wed Jan 21 23:18:12 1998 --- read-ical.c Thu Jan 22 01:55:44 1998 *************** *** 15,27 **** #include "pi-datebook.h" #include "pi-dlp.h" char * tclquote(char * in) { static char * buffer = 0; char * out; ! char * pos; int len; ! /* Skip leading bullet (and any whitespace after) */ if (in[0] == '\x95') { ++in; --- 15,33 ---- #include "pi-datebook.h" #include "pi-dlp.h" + #define isSjis1stByte(c) \ + (((c) >= 0x81 && (c) <= 0x9f) || ((c) >= 0xe0)) + + char * tclquote(char * in) { static char * buffer = 0; char * out; ! unsigned char * pos; int len; ! int inkanji = 0; ! ! #if 0 /* Skip leading bullet (and any whitespace after) */ if (in[0] == '\x95') { ++in; *************** *** 29,60 **** ++in; } } ! len = 3; ! pos = in; ! while(*pos) { ! if((*pos == '\\') || (*pos == '"') || (*pos == '[') || (*pos == '{') || (*pos == '$')) ! len++; ! len++; ! pos++; ! } ! if (buffer) ! free(buffer); ! buffer = (char*)malloc(len); ! out = buffer; ! ! pos = in; ! *out++ = '"'; ! while(*pos) { ! if((*pos == '\\') || (*pos == '"') || (*pos == '[') || (*pos == '{') || (*pos == '$')) ! *out++ = '\\'; ! *out++=*pos++; ! } ! *out++ = '"'; ! *out++ = '\0'; ! return buffer; } static void Usage(char *progname) --- 35,78 ---- ++in; } } + #endif ! len = 3; ! pos = in; ! while(*pos) { ! if (!inkanji && ((*pos == '\\') || (*pos == '"') || (*pos == '[') ! || (*pos == '{') || (*pos == '$'))) ! len++; ! if (inkanji) ! inkanji = 0; ! else if (isSjis1stByte(*pos)) ! inkanji = 1; ! len++; ! pos++; ! } ! if (buffer) ! free(buffer); ! buffer = (char*)malloc(len); ! out = buffer; ! ! pos = in; ! *out++ = '"'; ! inkanji = 0; ! while(*pos) { ! if (!inkanji && ((*pos == '\\') || (*pos == '"') || (*pos == '[') ! || (*pos == '{') || (*pos == '$'))) ! *out++ = '\\'; ! if (inkanji) ! inkanji = 0; ! else if (isSjis1stByte(*pos)) ! inkanji = 1; ! *out++ = *pos++; ! } ! *out++ = '"'; ! *out++ = '\0'; ! return buffer; } static void Usage(char *progname) </PRE> <HR> <P> <P> <HR> <A HREF="Pilot-HOWTO-7.html">$B<!$N%Z!<%8(B</A> <A HREF="Pilot-HOWTO-5.html">$BA0$N%Z!<%8(B</A> <A HREF="Pilot-HOWTO.html#toc6">$BL\<!$X(B</A> </BODY> </HTML>