diff -ruN joe-2.9.8/b.c zh-joe-2.9.8/b.c --- joe-2.9.8/b.c Fri Feb 21 17:43:52 2003 +++ zh-joe-2.9.8/b.c Thu Nov 3 22:57:58 2005 @@ -48,11 +48,11 @@ VFILE *vmem; char *msgs[] = { - "Error writing file", - "Error opening file", - "Error seeking file", - "Error reading file", - "New File" + "¼g¤JÀɮ׿ù»~", + "¶}±ÒÀɮ׿ù»~", + "´M§äÀɮ׿ù»~", + "Ū¨úÀɮ׿ù»~", + "·sÀÉ" }; /* Get size of gap (amount of free space) */ @@ -2162,18 +2162,18 @@ if ((f = fdopen(tmpfd, "a")) == NULL) _exit(-1); - fprintf(f, "\n*** Modified files in JOE when it aborted on %s", ctime(&tim)); + fprintf(f, "\n*** ©ó %s ®É¤£¥¿±`µ²§ôªº JOE ¦sÀÉ", ctime(&tim)); if (sig) - fprintf(f, "*** JOE was aborted by signal %d\n", sig); + fprintf(f, "*** JOE ¦] signal %d ¦Ó¤£¥¿±`µ²§ô\n", sig); else - fprintf(f, "*** JOE was aborted because the terminal closed\n"); + fprintf(f, "*** JOE ¦] terminal ³s½u¤¤Â_¦Ó¤£¥¿±`µ²§ô\n"); fflush(f); for (b = bufs.link.next; b != &bufs; b = b->link.next) if (b->changed) { if (b->name) - fprintf(f, "\n*** File \'%s\'\n", b->name); + fprintf(f, "\n*** ÀɦW¡G \'%s\'\n", b->name); else - fprintf(f, "\n*** File \'(Unnamed)\'\n"); + fprintf(f, "\n*** ÀɦW¡G \'(¥¼©R¦W)\'\n"); fflush(f); bsavefd(b->bof, fileno(f), b->eof->byte); } diff -ruN joe-2.9.8/bw.c zh-joe-2.9.8/bw.c --- joe-2.9.8/bw.c Thu Mar 6 15:24:26 2003 +++ zh-joe-2.9.8/bw.c Thu Nov 3 22:57:58 2005 @@ -734,9 +734,9 @@ int c = brc(bw->cursor); if (c == NO_MORE_DATA) - snprintf(buf, sizeof(buf), "** Line %ld Col %ld Offset %ld(0x%lx) **", bw->cursor->line + 1, piscol(bw->cursor) + 1, bw->cursor->byte, bw->cursor->byte); + snprintf(buf, sizeof(buf), "** ¦æ¼Æ %ld ¦C¼Æ %ld Àɮפj¤p %ld(0x%lx) **", bw->cursor->line + 1, piscol(bw->cursor) + 1, bw->cursor->byte, bw->cursor->byte); else - snprintf(buf, sizeof(buf), "** Line %ld Col %ld Offset %ld(0x%lx) Ascii %d(0%o/0x%X) **", bw->cursor->line + 1, piscol(bw->cursor) + 1, bw->cursor->byte, bw->cursor->byte, 255 & c, 255 & c, 255 & c); + snprintf(buf, sizeof(buf), "** ¦æ¼Æ %ld ¦C¼Æ %ld Àɮפj¤p %ld(0x%lx) Ascii½X %d(0%o/0x%X) **", bw->cursor->line + 1, piscol(bw->cursor) + 1, bw->cursor->byte, bw->cursor->byte, 255 & c, 255 & c, 255 & c); msgnw(bw->parent, buf); return 0; } diff -ruN joe-2.9.8/cmd.c zh-joe-2.9.8/cmd.c --- joe-2.9.8/cmd.c Mon Mar 24 17:19:09 2003 +++ zh-joe-2.9.8/cmd.c Thu Nov 3 22:57:58 2005 @@ -206,7 +206,7 @@ goto skip; if ((maint->curwin->watom->what & TYPETW) && bw->b->rdonly && (cmd->flag & EMOD)) { - msgnw(bw->parent, "Read only"); + msgnw(bw->parent, "°ßŪ"); if (beep) ttputc(7); goto skip; @@ -409,7 +409,7 @@ vsrm(s); /* allocated in pw.c::rtnpw() */ if (!cmd) - msgnw(bw->parent, "No such command"); + msgnw(bw->parent, "¨S¦³³o¶µ«ü¥O"); else { mac = mkmacro(MAXINT, 0, 0, cmd); ret = exmacro(mac, 1); diff -ruN joe-2.9.8/joerc.in zh-joe-2.9.8/joerc.in --- joe-2.9.8/joerc.in Tue Dec 11 00:48:54 2001 +++ zh-joe-2.9.8/joerc.in Thu Nov 3 22:57:59 2005 @@ -24,7 +24,7 @@ -marking Text between ^KB and cursor is highlighted (use with -lightoff) - -asis Characters 128 - 255 shown as-is +-asis Characters 128 - 255 shown as-is -force Force final newline when files are saved @@ -101,7 +101,7 @@ \f Blink -lmsg \i%k%T%W%I%X %n %m%R %M --rmsg %S Row %r Col %c %t Ctrl-K H for help +-rmsg %S ¦æ¼Æ %r ¦C¼Æ %c %t Ctrl-K H ½u¤W»²§U SECOND SECTION: File name dependant local option settings: @@ -177,73 +177,75 @@ Use \f to turn on/off flash {Basic -\i Help Screen turn off with ^KH more help with ESC . (^[.) \i -\i \i\uCURSOR\u \uGO TO\u \uBLOCK\u \uDELETE\u \uMISC\u \uEXIT\u \i \i -\i \i^B left ^F right ^U prev. screen ^KB begin ^D char. ^KJ reformat ^KX save \i \i -\i \i^P up ^N down ^V next screen ^KK end ^Y line ^T options ^C abort \i \i -\i \i^Z previous word ^A beg. of line ^KM move ^W >word ^R refresh ^KZ shell \i \i -\i \i^X next word ^E end of line ^KC copy ^O word< ^@ insert \uFILE\u \i \i -\i \i\uSEARCH\u ^KU top of file ^KW file ^J >line \uSPELL\u ^KE edit \i \i -\i \i^KF find text ^KV end of file ^KY delete ^_ undo ^[N word ^KR insert\i \i -\i \i^L find next ^KL to line No. ^K/ filter ^^ redo ^[L file ^KD save \i \i +\i ½u¤W»²§Uµøµ¡ ^KH Ãö³¬»²§Uµøµ¡ ESC . ¶}±Ò§ó¦h»²§Uµøµ¡ (^[.) \i +\i \i\u´å ¼Ð\u \u²¾ °Ê\u \u°Ï ¶ô\u \u§R °£\u \uÂø¶µ\u \uÂ÷¶}\u \i \i +\i \i^B ©¹¥ª ^F ©¹¥k ^U ¤W¤@­Óµøµ¡ ^KB °_©l ^D ¦r¤¸ ^KJ ­«·s±Æ¦C ^KX ¦sÀÉ \i \i +\i \i^P ©¹¤W ^N ©¹¤U ^V ¤U¤@­Óµøµ¡ ^KK µ²§ô ^Y ¾ã¦æ ^T ³]©w¿ï¶µ ^C ©ñ±ó \i \i +\i \i^Z «e¤@­Ó¦r ^A ³æ¦æªº³Ì«e­± ^KM ²¾°Ê ^W >³æ¦r ^R ¿Ã¹õ§ó·s ^KZ SHELL \i \i +\i \i^X ¤U¤@­Ó¦r ^E ³æ¦æªº³Ì«á­± ^KC «þ¨© ^O ³æ¦r< ^@ ´¡¤JªÅ¥Õ \uÀÉ®×\u \i \i +\i \i\u·j ´M\u ^KU Àɮ׳̫e­± ^KW ¦sÀÉ ^J >¦æ§À \u«÷ ¦r\u ^KE ½s¿è \i \i +\i \i^KF ·j´M¦r¦ê ^KV Àɮ׳̫᭱ ^KY §R°£ ^_ ´_­ì ^[N ¦r ^KR ´¡¤J \i \i +\i \i^L ¤U¤@¦r¦ê ^KL ¸õ©¹²Ä´X¦æ ^K/ ¹LÂo ^^ ¤£´_­ì ^[L ÀÉ®× ^KD ¦sÀÉ \i \i } {Windows -\i Help Screen turn off with ^KH prev. screen ^[, next screen ^[. \i -\i \i^KO Split the window in half ^KE Load file into window \i \i -\i \i^KG Make current window bigger ^KT Make current window smaller \i \i -\i \i^KN Go to the window below ^KP Go to the window above \i \i -\i \i^C Eliminate the current window ^KI Show all windows / Show one window\i \i +\i ½u¤W»²§Uµøµ¡ ^KH Ãö³¬»²§Uµøµ¡ «e¤@­¶»²§Uµøµ¡ ^[, ¤U¤@­¶»²§Uµøµ¡^[. \i +\i \i^KO ¤À³Îµøµ¡¬°¤G ^KE ¸ü¤JÀɮ׶i¤J´å¼Ð©Ò¦bµøµ¡ \i \i +\i \i^KG ©ñ¤j´å¼Ð©Ò¦bµøµ¡ ^KT ÁY¤p´å¼Ð©Ò¦bµøµ¡ \i \i +\i \i^KN ¸õ©¹¤U¤@­Óµøµ¡ ^KP ¸õ©¹«e¤@­Óµøµ¡ \i \i +\i \i^C ®ø°£´å¼Ð©Ò¦bµøµ¡ ^KI Åã¥Ü©Ò¦³µøµ¡ /Åã¥Ü´å¼Ð©Ò¦bµøµ¡ \i \i } {Advanced -\i Help Screen turn off with ^KH prev. screen ^[, next screen ^[. \i -\i \i\uMACROS\u \uMISC\u \uSCROLL\u \uSHELL\u \uGOTO\u \uI-SEARCH\u \i \i -\i \i^K[ 0-9 Record ^K SPACE status ^[W Up ^K' Window ^[B To ^KB ^[R Backwards\i \i -\i \i^K] Stop ^K\\ Repeat ^[Z Down ^[! Command ^[K To ^KK ^[S Forwards \i \i -\i \i^K 0-9 Play ^[M Math ^K< Left \uQUOTE\u \uDELETE\u \uBOOKMARKS\u \i \i -\i \i^K? Query ^KA Center line ^K> Right ` Ctrl- ^[Y yank ^[ 0-9 Goto \i \i -\i \i^[D Dump ^[H Message ^\\ Meta- ^[O line< ^[^[ Set \i \i +\i ½u¤W»²§Uµøµ¡ ^KH Ãö³¬»²§Uµøµ¡ «e¤@­¶»²§Uµøµ¡ ^[, ¤U¤@­¶»²§Uµøµ¡ ^[. \i +\i \i\u¥¨ ¶°\u \uÂø¶µ\u \u±² ¶b\u \uSHELL\u \u²¾°Ê\u \u§Y®É·j´M\u \i \i +\i \i^K[ 0-9 °O¿ý ^K SPACE ª¬ºA^[W ©¹¤W ^K' µøµ¡¼Ò¦¡ ^[B ²¾©¹ ^KB ³B ^[R ©¹«á·j´M\i \i +\i \i^K] °±¤î ^K\\ ­«ÂЩR¥O ^[Z ©¹¤U ^[! ©R¥O¼Ò¦¡ ^[K ²¾©¹ ^KK ³B ^[S ©¹«e·j´M\i \i +\i \i^K 0-9 ±Ò°Ê ^[M ¼Æ¾Ç ^K< ©¹¥ª \u¤Þ ¥Î\u \u§R °£\u \u®Ñ ÅÒ\u \i \i +\i \i^K? ¬d¸ß ^KA ¤¤¶¡¹ï»ô ^K> ©¹¥k ` ±±¨î¦r¤¸ ^[Y ¤U©Ô¤@¦æ ^[ 0-9 ²¾°Ê \i \i +\i \i^[D ¶É¦L ^[H °T®§ ^\\ Meta- ^[O §R«e­±¤@¦æ ^[^[ ³]©w \i \i } {Programs -\i Help Screen turn off with ^KH prev. screen ^[, next screen ^[. \i -\i \i\uGOTO\u \uINDENT\u \uCOMPILING\u \i \i -\i \i^G Matching ( [ { ^K, less ^[C Compile and parse errors \i \i -\i \i^K- Previous place ^K. more ^[E Parse errors \i \i -\i \i^K= Next place ^[= To next error \i \i -\i \i^K; Tags file search ^[- To prev. error \i \i +\i ½u¤W»²§Uµøµ¡ ^KH Ãö³¬»²§Uµøµ¡ «e¤@­¶»²§Uµøµ¡ ^[, ¤U¤@­¶»²§Uµøµ¡ ^[. \i +\i \i\u²¾°Ê\u \u¤À ³Î\u \u½s Ķ\u \i \i +\i \i^G ¦¨¹ï·j´M ( [ { ^K, °Ï¶ô¥ª²¾ ^[C ½sĶ¨Ã¦C¥X¿ù»~ \i \i +\i \i^K- «e¤@­Ó´å¼Ð¦ì¸m ^K. °Ï¶ô¥k²¾ ^[E ¦C¥X¿ù»~ \i \i +\i \i^K= ¤U¤@­Ó´å¼Ð¦ì¸m ^[= ¸õ¦Ü¤U¤@­Ó¿ù»~ \i \i +\i \i^K; ¼ÐÅÒÀÉ·j´M ^[- ¦^¨ì¤W¤@­Ó¿ù»~ \i \i } {Search -\i Help Screen turn off with ^KH prev. screen ^[, next screen ^[. \i -\i \iSpecial search sequences: \i \i -\i \i \\^ \\$ matches beg./end of line \\? match any single char \i \i -\i \i \\< \\> matches beg./end of word \\* match 0 or more chars \i \i -\i \i \\c matches balanced C expression \\\\ matches a \\ \i \i -\i \i \\[..] matches one of a set \\n matches a newline \i \i -\i \i \\+ matches 0 or more of the character which follows the \\+ \i \i -\i \iSpecial replace sequences: \i \i -\i \i \\& replaced with text which matched search string \i \i -\i \i \\0 - 9 replaced with text which matched Nth \\*, \\?, \\c, \\+, or \\[..] \i \i -\i \i \\\\ replaced with \\ \\n replaced with newline \i \i +\i ½u¤W»²§Uµøµ¡ ^KH Ãö³¬»²§Uµøµ¡ «e¤@­¶»²§Uµøµ¡ ^[, ¤U¤@­¶»²§Uµøµ¡ ^[. \i +\i \i\u¯S®í·j´M±ø¥ó\u \i \i +\i \i \\^ \\$ ¦ì©ó¦æ­º/§Àªº²Å¦X¦r¦ê \\? ¥N´À¥ô¦ó¤@­Ó¦r¤¸ \i \i +\i \i \\< \\> ¦ì©ó¦r­º/§Àªº²Å¦X¦r¦ê \\* ¥N´À¥ô·N¦r¤¸ \i \i +\i \i \\c ²Å¦X C »y¨¥®æ¦¡ªºªí¥Ü¥Ü¦r¦ê \\\\ §ä´M \"\\"\" \i \i +\i \i \\[..] ²Å¦X©Ò«ü©w¶°¦X¤¤ªº¥ô¤@¦r¦ê \\n ¥Nªí¤@­Ó´«¦æ²Å¸¹ \i \i +\i \i \\+ ²Å¦X¤@­Ó©Î¬O¦h­Ó¥H¤Wªþ¥[©ó \"+\" ¸¹«á­±«ü©w±ø¥óªº¦r¦ê \i \i +\i \i\u¯S®í¨ú¥N±ø¥ó\u \i \i +\i \i \\& ª½±µ¥H´À¥N¦r¤¸¨ú¥N§ä´M¨ìªº¦r¦ê(¤£¥[¸ß°Ý) \i \i +\i \i \\0 - 9 ª½±µ¥H´À¥N¦r¤¸¨ú¥N²Ä n ­Ó¦r¦ê \\*, \\?, \\c, \\+, or \\[..] \i \i +\i \i \\\\ ¥H \"\\\"¨Ó¨ú¥N \\n ¥H´«¦æ²Å¸¹¨Ó¨ú¥N \i \i } {Names -\i Help Screen turn off with ^KH prev. screen ^[, next screen ^[. \i -\i \i Hit TAB at file name prompts to generate menu of file names \i \i -\i \i Or use up/down keys to access history of previously entered names \i \i -\i \i Special file names: \i \i -\i \i !command Pipe in/out of a shell command \i \i -\i \i >>filename Append to a file \i \i -\i \i - Read/Write to/from standard I/O \i \i -\i \i filename,START,SIZE Read/Write a part of a file/device \i \i -\i \i Give START/SIZE in decimal (255), octal (0377) or hex (0xFF) \i \i +\i ½u¤W»²§Uµøµ¡ ^KH Ãö³¬»²§Uµøµ¡ «e¤@­¶»²§Uµøµ¡ ^[, ¤U¤@­¶»²§Uµøµ¡ ^[. \i +\i \i ¦b¿é¤JÀɮצWºÙªº´£¥Üµøµ¡¤¤¡A«ö¤U TAB Áä¥i¥H²£¥Í¤@­Ó±z¥Ø«e©Ò¦b¥Ø¿ý¤Uªº©Ò¦³ \i \i +\i \i ÀɮצW¦rªº¦Cªí¡A©Î¬O¨Ï¥Î¤W¤UÁä¨Ó¨Ï¥Î¥H«e¥Î¹LªºÀɮצWºÙ. \i \i +\i \i ¯S®íªºÀɮצWºÙ¡G \i \i +\i \i !command ¤Þ¤J¤@­Ó shell ©³¤Uªº©R¥O \i \i +\i \i >>filename §â²{¦³ÀÉ®§ªþ¥[¨ì¥t¤@Àɮפ¤ \i \i +\i \i - ±q¼Ð·Çªº I/O ³]³Æ¤¤Åª¤J/¼g¥X \i \i +\i \i filename,START,SIZE ±q¤@­ÓÀÉ®×/³]³Æ¤¤Åª¤J/¼g¥X³¡¥÷¸ê®Æ \i \i +\i \i µ¹©wÀɮ׶}©lªº¦ì¸m/Àɮפj¤p ¥H¤Q¶i¦ì(255), ¤K¦ì¦ì(0377), ¤Q¤»¶i¶i(0xFF) \i \i } {Joe -\i Help Screen turn off with ^KH prev. screen ^[, \i -\i \i Send bug reports to: Marek 'Marx' Grac (xgrac@fi.muni.cz) \i \i +\i ½u¤W»²§Uµøµ¡ ^KH Ãö³¬»²§Uµøµ¡ ^[, «e¤@­¶»²§Uµøµ¡ \i +\i \i [***JOE 2.9.8 ¤¤¤åª©***] [** ¤¤¤å¤Æ¡G°ê¥ß¥æ³q¤j¾Ç À³¥Î¼Æ¾Ç¨t 86¯Å ¿à¦³±o **]\i \i +\i \i ¦³¥ô¦ó°ÝÃD½Ð email ¦Ü u8222034@cc.nctu.edu.tw ©Î u8222034@math.nctu.edu.tw \i \i +\i \i ­^¤åª©¦³¥ô¦ó°ÝÃD½Ð Send bug reports to: Marek 'Marx' Grac (xgrac@fi.muni.cz)\i \i } FOURTH SECTION: Key bindings: @@ -308,6 +310,7 @@ :windows Bindings common to all windows type ^@ TO ÿ Type a character abort ^C Abort window +abort .k4 abort ^K Q abort ^K ^Q abort ^K q @@ -432,7 +435,7 @@ Standard JOE user interface quote8 ^\ Enter Meta chars -quote ` Enter Ctrl chars +quote .k; Enter Ctrl chars backs ^? Backspace backs ^H diff -ruN joe-2.9.8/macro.c zh-joe-2.9.8/macro.c --- joe-2.9.8/macro.c Thu Mar 6 15:24:28 2003 +++ zh-joe-2.9.8/macro.c Thu Nov 3 22:57:58 2005 @@ -483,7 +483,7 @@ { if (c >= '0' && c <= '9') return dorecord(bw, c, NULL, NULL); - else if (mkqw(bw->parent, sc("Macro to record (0-9 or ^C to abort): "), dorecord, NULL, NULL, NULL)) + else if (mkqw(bw->parent, sc("¿ý»s¥¨¶° (0-9 ©Î ^C ¤¤Â_): "), dorecord, NULL, NULL, NULL)) return 0; else return -1; @@ -554,7 +554,7 @@ { if (c >= '0' && c <= '9') return doplay(bw, c, NULL, NULL); - else if (mkqwna(bw->parent, sc("Play-"), doplay, NULL, NULL, NULL)) + else if (mkqwna(bw->parent, sc("°õ¦æ-"), doplay, NULL, NULL, NULL)) return 0; else return -1; @@ -581,7 +581,7 @@ int uarg(BW *bw) { - if (wmkpw(bw->parent, "No. times to repeat next command (^C to abort): ", NULL, doarg, NULL, NULL, utypebw, NULL, NULL)) + if (wmkpw(bw->parent, "¤U¤@­Ó«ü¥O­«½Æªº¦¸¼Æ¬° (^C ¤¤Â_): ", NULL, doarg, NULL, NULL, utypebw, NULL, NULL)) return 0; else return -1; @@ -620,7 +620,7 @@ *notify = 1; return 0; } - snprintf(msgbuf, JOE_MSGBUFSIZE, "Repeat %s%d", negarg ? "-" : "", unaarg); + snprintf(msgbuf, JOE_MSGBUFSIZE, "­«½Æ %s%d", negarg ? "-" : "", unaarg); if (mkqwna(bw->parent, sz(msgbuf), douarg, NULL, NULL, notify)) return 0; else @@ -633,7 +633,7 @@ negarg = 0; if ((c >= '0' && c <= '9') || c == '-') return douarg(bw, c, NULL, NULL); - else if (mkqwna(bw->parent, sc("Repeat"), douarg, NULL, NULL, NULL)) + else if (mkqwna(bw->parent, sc("­«½Æ"), douarg, NULL, NULL, NULL)) return 0; else return -1; diff -ruN joe-2.9.8/main.c zh-joe-2.9.8/main.c --- joe-2.9.8/main.c Mon May 5 15:14:25 2003 +++ zh-joe-2.9.8/main.c Thu Nov 3 22:57:59 2005 @@ -207,7 +207,7 @@ #ifndef __MSDOS__ if (!(cap = getcap(NULL, 9600, NULL, NULL))) { - fprintf(stderr, "Couldn't load termcap/terminfo entry\n"); + fprintf(stderr, "µLªk¸ü¤J termcap/terminfo ¶µ¥Ø\n"); return 1; } #endif @@ -222,7 +222,7 @@ if (c == 1) { char buf[8]; - fprintf(stderr, "There were errors in '%s'. Use it anyway?", s); + fprintf(stderr, "¦b '%s' ¤¤¦³¿ù»~. ­n¨Ï¥Î¥¦¶Ü¡H", s); fflush(stderr); fgets(buf, 8, stdin); if (buf[0] == 'y' || buf[0] == 'Y') @@ -239,7 +239,7 @@ if (c == 1) { char buf[8]; - fprintf(stderr, "There were errors in '%s'. Use it anyway?", s); + fprintf(stderr, "¦b '%s' ¤¤¦³¿ù»~. ­n¨Ï¥Î¥¦¶Ü¡H", s); fflush(stderr); fgets(buf, 8, stdin); if (buf[0] == 'y' || buf[0] == 'Y') @@ -259,7 +259,7 @@ if (c == 1) { char buf[8]; - fprintf(stderr, "There were errors in '%s'. Use it anyway?", s); + fprintf(stderr, "¦b '%s' ¤¤¦³¿ù»~. ­n¨Ï¥Î¥¦¶Ü¡H", s); fflush(stderr); fgets(buf, 8, stdin); if (buf[0] == 'y' || buf[0] == 'Y') @@ -277,7 +277,7 @@ if (c == 1) { char buf[8]; - fprintf(stderr, "There were errors in '%s'. Use it anyway?", s); + fprintf(stderr, "¦b '%s' ¤¤¦³¿ù»~. ­n¨Ï¥Î¥¦¶Ü¡H", s); fflush(stderr); fgets(buf, 8, stdin); if (buf[0] == 'y' || buf[0] == 'Y') @@ -285,7 +285,7 @@ } #endif - fprintf(stderr, "Couldn't open '%s'\n", s); + fprintf(stderr, "µLªk¶}±Ò '%s'\n", s); return 1; donerc: @@ -295,7 +295,7 @@ if (argv[c][1]) switch (glopt(argv[c] + 1, argv[c + 1], NULL, 1)) { case 0: - fprintf(stderr, "Unknown option '%s'\n", argv[c]); + fprintf(stderr, "¤£ª¾¦Wªº¿ï¶µ '%s'\n", argv[c]); break; case 1: break; diff -ruN joe-2.9.8/menu.c zh-joe-2.9.8/menu.c --- joe-2.9.8/menu.c Thu Mar 6 15:24:28 2003 +++ zh-joe-2.9.8/menu.c Thu Nov 3 22:57:57 2005 @@ -32,10 +32,13 @@ for (x = 0; x != m->perline && m->list[x + m->top]; ++x) { int atr, z; + atr = 0; +/* if (x + m->top == m->cursor) atr = INVERSE; else atr = 0; +*/ if (col == m->w) break; for (z = 0; m->list[x + m->top][z]; ++z) { diff -ruN joe-2.9.8/rc.c zh-joe-2.9.8/rc.c --- joe-2.9.8/rc.c Mon Mar 24 17:19:09 2003 +++ zh-joe-2.9.8/rc.c Thu Nov 3 22:57:57 2005 @@ -100,7 +100,7 @@ 1, /* indent step */ "main", /* *context */ "\\i%n %m %M", /* *lmsg */ - " %S Ctrl-K H for help", /* *rmsg */ + " %S Ctrl-K H ½u¤W»²§U", /* *rmsg */ 0, /* line numbers */ 0, /* read only */ 0, /* french spacing */ @@ -149,33 +149,33 @@ int low; /* Low limit for numeric options */ int high; /* High limit for numeric options */ } glopts[] = { - { "overwrite", 4, NULL, (char *) &fdefault.overtype, "Overtype mode", "Insert mode", "T Overtype " }, - { "autoindent", 4, NULL, (char *) &fdefault.autoindent, "Autoindent enabled", "Autindent disabled", "I Autoindent " }, - { "wordwrap", 4, NULL, (char *) &fdefault.wordwrap, "Wordwrap enabled", "Wordwrap disabled", "Word wrap " }, - { "tab", 5, NULL, (char *) &fdefault.tab, "Tab width (%d): ", 0, "D Tab width ", 0, 1, 64 }, - { "lmargin", 7, NULL, (char *) &fdefault.lmargin, "Left margin (%d): ", 0, "Left margin ", 0, 0, 63 }, - { "rmargin", 7, NULL, (char *) &fdefault.rmargin, "Right margin (%d): ", 0, "Right margin ", 0, 7, 255 }, - { "square", 0, &square, NULL, "Rectangle mode", "Text-stream mode", "X Rectangle mode " }, - { "indentc", 5, NULL, (char *) &fdefault.indentc, "Indent char %d (SPACE=32, TAB=9, ^C to abort): ", 0, " Indent char ", 0, 0, 255 }, - { "istep", 5, NULL, (char *) &fdefault.istep, "Indent step %d (^C to abort): ", 0, " Indent step ", 0, 1, 64 }, - { "french", 4, NULL, (char *) &fdefault.french, "One space after periods for paragraph reformat", "Two spaces after periods for paragraph reformat", " french spacing " }, - { "spaces", 4, NULL, (char *) &fdefault.spaces, "Inserting spaces when tab key is hit", "Inserting tabs when tab key is hit", " no tabs " }, - { "mid", 0, &mid, NULL, "Cursor will be recentered on scrolls", "Cursor will not be recentered on scroll", "Center on scroll " }, - { "crlf", 4, NULL, (char *) &fdefault.crlf, "CR-LF is line terminator", "LF is line terminator", "Z CR-LF (MS-DOS) " }, - { "linums", 4, NULL, (char *) &fdefault.linums, "Line numbers enabled", "Line numbers disabled", "N Line numbers " }, - { "marking", 0, &marking, NULL, "Anchored block marking on", "Anchored block marking off", "Marking " }, - { "asis", 0, &dspasis, NULL, "Characters above 127 shown as-is", "Characters above 127 shown in inverse", "Meta chars as-is " }, - { "force", 0, &force, NULL, "Last line forced to have NL when file saved", "Last line not forced to have NL", "Force last NL " }, - { "nobackups", 0, &nobackups, NULL, "Backup files will not be made", "Backup files will be made", " Disable backups " }, - { "lightoff", 0, &lightoff, NULL, "Highlighting turned off after block operations", "Highlighting not turned off after block operations", "Auto unmark " }, - { "exask", 0, &exask, NULL, "Prompt for filename in save & exit command", "Don't prompt for filename in save & exit command", "Exit ask " }, - { "beep", 0, &beep, NULL, "Warning bell enabled", "Warning bell disabled", "Beeps " }, - { "nosta", 0, &staen, NULL, "Top-most status line disabled", "Top-most status line enabled", " Disable status line " }, - { "keepup", 0, &keepup, NULL, "Status line updated constantly", "Status line updated once/sec", " Fast status line " }, - { "pg", 1, &pgamnt, NULL, "Lines to keep for PgUp/PgDn or -1 for 1/2 window (%d): ", 0, " No. PgUp/PgDn lines ", 0, -1, 64 }, - { "csmode", 0, &csmode, NULL, "Start search after a search repeats previous search", "Start search always starts a new search", "Continued search " }, - { "rdonly", 4, NULL, (char *) &fdefault.readonly, "Read only", "Full editing", "O Read only " }, - { "backpath", 2, (int *) &backpath, NULL, "Backup files stored in (%s): ", 0, "Path to backup files " }, + { "overwrite", 4, NULL, (char *) &fdefault.overtype, "Âмg¼Ò¦¡", "´¡¤J¼Ò¦¡", "T [**¿é¤J¼Ò¦¡ªº³]©w(overwrite)**] " }, + { "autoindent", 4, NULL, (char *) &fdefault.autoindent, "¦Û°ÊÁY±Æ [¶}±Ò]", "¦Û°ÊÁY±Æ [Ãö³¬]", "I [**¦Û°ÊÁY±Æªº³]©w(autoindent)**] " }, + { "wordwrap", 4, NULL, (char *) &fdefault.wordwrap, "¦Û°Ê´«¦æ [¶}±Ò]", "¦Û°Ê´«¦æ [Ãö³¬]", "* [**¦Û°Ê´«¦æªº³]©w(wordwrap)**] " }, + { "tab", 5, NULL, (char *) &fdefault.tab, "Tab ¼e«× (%d): ", 0, "D [**Tab¼eªøªº³]©w(tab)**] ", 0, 1, 64 }, + { "lmargin", 7, NULL, (char *) &fdefault.lmargin, "³]©w¥ªÃä¬É (%d): ", 0, "L [**³]©w¥ªÃä¬É(lmargin)**] ", 0, 0, 63 }, + { "rmargin", 7, NULL, (char *) &fdefault.rmargin, "³]©w¥kÃä¬É (%d): ", 0, "* [**³]©w¥kÃä¬É(rmargin)**] ", 0, 7, 255 }, + { "square", 0, &square, NULL, "¯x§Î¿ï¨ú", "¦æ¦C¿ï¨ú", "X [**¿ï¨ú°Ï¶ô¼Ò¦¡(square)**] " }, + { "indentc", 5, NULL, (char *) &fdefault.indentc, "³]©wÁY±Æ¦r¤¸ %d (SPACE=32, TAB=9, ^C ¤¤Â_): ", 0, "* [**ÁY±Æªø«×ªº³]©w(indentc)**] ", 0, 0, 255 }, + { "istep", 5, NULL, (char *) &fdefault.istep, "³]©wÁY±Æ¬q¸¨ %d (^C ¤¤Â_): ", 0, "* [**³]©wÁY±Æªº¬q¸¨(istep)**] ", 0, 1, 64 }, + { "french", 4, NULL, (char *) &fdefault.french, "¬q¸¨­«±Æ«á¦h 1 ­ÓªÅ¥Õ", "¬q¸¨­«±Æ«á¦h 2 ­ÓªÅ¥Õ", "* [**³]©wªk°ê¦¡¬q¸¨±Æ¦C(french)**] " }, + { "spaces", 4, NULL, (char *) &fdefault.spaces, "³]©w«ö¤U [TAB] «á´¡¤J [ªÅ¥Õ] ¦r¤¸ ", "³]©w«ö¤U [TAB] «á´¡¤J [TAB ] ¦r¤¸ ", "* [**³]©w TAB Áä¥Î³~(spaces)**] " }, + { "mid", 0, &mid, NULL, "¿Ã¹õ±²°Ê«á´å¼Ð¦Û°Ê¦V¤¤¶¡¹ï»ô¥\\¯à [¶}±Ò", "¿Ã¹õ±²°Ê«á´å¼Ð¦Û°Ê¦V¤¤¶¡¹ï»ô¥\\¯à [Ãö³¬]", "* [**´å¼Ð¦V¤¤¹ï»ô(mid)**] " }, + { "crlf", 4, NULL, (char *) &fdefault.crlf, "¦æªºµ²§À¬O CR-LF(DOS)", "¦æªºµ²§À¬O LF(UNIX)", "Z [*¦æ§À¦r¤¸ªº³]©w(crlf)*] " }, + { "linums", 4, NULL, (char *) &fdefault.linums, "Åã¥Ü¦æ¼Æ¥\\¯à [¶}±Ò]", "Åã¥Ü¦æ¼Æ¥\\¯à [Ãö³¬]", "N [***¦æ¼ÆÅã¥Ü»P§_(linums)***] " }, + { "marking", 0, &marking, NULL, "¤Ï¥Õ°Ï¶ôÀH´å¼Ð²¾°Ê¥\\¯à [¶}±Ò]", "¤Ï¥Õ°Ï¶ôÀH´å¼Ð²¾°Ê¥\\¯à [Ãö³¬]", "* [**°Ï¶ô¤Ï¥Õ³]©w(marking)**] " }, + { "asis", 0, &dspasis, NULL, "Åã¥Ü ASCII 127 ¥H¤Wªº¦r¤¸", "¥H¬Û¤Ï¤è¦¡¨ÓÅã¥Ü ASCII 127 ¥H¤Wªº¦r¤¸", "* [**¤¤¤åÅã¥Ü¤è¦¡(asis)**] " }, + { "force", 0, &force, NULL, "¦sÀÉ«á¡AÀɧÀ¦Û°Ê¥[¤W¤@¦æªÅ¥Õ¦æ¥\\¯à [¶}±Ò]", "¦sÀÉ«á¡AÀɧÀ¦Û°Ê¥[¤W¤@¦æªÅ¥Õ¦æ¥\\¯à [Ãö³¬]", "* [**¦sÀÉ®ÉÀɧÀªº³]©w(force)**] " }, + { "nobackups", 0, &nobackups, NULL, "¦Û°Ê²£¥Í³Æ¥÷ÀÉ¥\\¯à [Ãö³¬]", "¦Û°Ê²£¥Í³Æ¥÷ÀÉ¥\\¯à [¶}±Ò]", "* [**¦Û°Ê³Æ¥÷ªº³]©w(nobackups)**] " }, + { "lightoff", 0, &lightoff, NULL, "¨Ï¥Î°Ï¶ô¥\\¯à«á¡A¦Û°ÊÃö³¬°ª«G«×°Ï¶ô¥\\¯à [Ãö³¬]", "¨Ï¥Î°Ï¶ô¥\\¯à«á¡A¦Û°ÊÃö³¬°ª«G«×°Ï¶ô¥\\¯à [¶}±Ò]", "* [**°Ï¶ô«G«×³]©w**] " }, + { "exask", 0, &exask, NULL, "Â÷¶}®É¬O§_°Ý­n¦sªºÀɦW [¬Oªº]", "Â÷¶}®É¬O§_°Ý­n¦sªºÀɦW [¤£­n]", "* [**Â÷¶}®É¸ß°Ý­n¦sÀɪºÀɦW(exask)** " }, + { "beep", 0, &beep, NULL, "¿ù»~®Éµo¥X\"¹Í\"ªºÁn­µ¥\\¯à [¶}±Ò]", "¿ù»~®Éµo¥X\"¹Í\"ªºÁn­µ¥\\¯à [Ãö³¬]", "* [**¿ù»~®É¡A¬O§_µo\"¹Í\"Án(beep)**] " }, + { "nosta", 0, &staen, NULL, "¶}±Ò³Ì¤W­±ªºª¬ºA¦C¥\\¯à[Ãö³¬]", "¶}±Ò³Ì¤W­±ªºª¬ºA¦C¥\\¯à[¶}±Ò]", "* [**ª¬ºA¦C¶}Ãö(nosta)**] " }, + { "keepup", 0, &keepup, NULL, "ª¬ºA¦C©T©w®É¶¡§ó·s¸ê®Æ¤@¦¸", "ª¬ºA¦C¨C¬í§ó·s¸ê®Æ¤@¦¸", "* [**ª¬ºA¦C¸ê®Æ§ó·s(keepup)**] " }, + { "pg", 1, &pgamnt, NULL, "«ö¤U [PgUp]/[PgDn] ®É©Ò«O¯dªº¦æ¼Æ ©Î -1(«O¯d¥b­Óµøµ¡) (%d): ", 0, "* [**«öPaUp/PaDn ®Éªº¦æ¼Æ(pg)**] ", 0, -1, 64 }, + { "csmode", 0, &csmode, NULL, "«ö¤U CTRL + F ¥H«e­±©Ò¿é¤Jªº¦r¦ê¶}©l·j´M", "«ö¤U CTRL + F ³£¥H·sªº¦r¦ê¶i¦æ·j´M", "* [**·j´M¦r¤¸ªº³]©w(csmode)**] " }, + { "rdonly", 4, NULL, (char *) &fdefault.readonly, "°ßŪ¼Ò¦¡", "¥i½s¿è¼Ò¦¡", "O [**°ßŪ¼Ò¦¡³]©w(rdonly)**] " }, + { "backpath", 2, (int *) &backpath, NULL, "³Æ¥÷ÀÉÀx¦s¸ô®|(%s): ", 0, "* [**³Æ¥÷Àɮ׸ô®|(backpath)**] " }, { "nonotice", 0, &nonotice, NULL, 0, 0, 0 }, { "noxon", 0, &noxon, NULL, 0, 0, 0 }, { "orphan", 0, &orphan, NULL, 0, 0, 0 }, @@ -387,7 +387,7 @@ } else if (v >= glopts[x].low && v <= glopts[x].high) *glopts[x].set = v; else { - msgnw(bw->parent, "Value out of range"); + msgnw(bw->parent, "¼Æ­È¶W¹L½d³ò"); ret = -1; } break; @@ -403,7 +403,7 @@ } else if (v >= glopts[x].low && v <= glopts[x].high) *(int *) ((char *) &bw->o + glopts[x].ofst) = v; else { - msgnw(bw->parent, "Value out of range"); + msgnw(bw->parent, "¼Æ­È¶W¹L½d³ò"); ret = -1; } break; @@ -415,7 +415,7 @@ } else if (v >= glopts[x].low && v <= glopts[x].high) *(int *) ((char *) &bw->o + glopts[x].ofst) = v; else { - msgnw(bw->parent, "Value out of range"); + msgnw(bw->parent, "¼Æ­È¶W¹L½d³ò"); ret = -1; } break; @@ -530,7 +530,7 @@ s[x] = (char *) joe_malloc(40); /* FIXME: why 40 ??? */ switch (glopts[x].type) { case 0: - snprintf(s[x], OPT_BUF_SIZE, "%s%s", glopts[x].menu, *glopts[x].set ? "ON" : "OFF"); + snprintf(s[x], OPT_BUF_SIZE, "%s%s", glopts[x].menu, *glopts[x].set ? "¶}" : "Ãö"); break; case 1: snprintf(s[x], OPT_BUF_SIZE, "%s%d", glopts[x].menu, *glopts[x].set); @@ -539,7 +539,7 @@ strcpy(s[x], glopts[x].menu); break; case 4: - snprintf(s[x], OPT_BUF_SIZE, "%s%s", glopts[x].menu, *(int *) ((char *) &bw->o + glopts[x].ofst) ? "ON" : "OFF"); + snprintf(s[x], OPT_BUF_SIZE, "%s%s", glopts[x].menu, *(int *) ((char *) &bw->o + glopts[x].ofst) ? "¶}" : "Ãö"); break; case 5: snprintf(s[x], OPT_BUF_SIZE, "%s%d", glopts[x].menu, *(int *) ((char *) &bw->o + glopts[x].ofst)); @@ -582,7 +582,7 @@ if (!fd) return -1; /* Return if we couldn't open the rc file */ - fprintf(stderr, "Processing '%s'...", name); + fprintf(stderr, "'%s'³B²z¤¤...", name); fflush(stderr); while (fgets(buf, sizeof(buf), fd)) { @@ -621,7 +621,7 @@ buf[x] = 0; if (!glopt(opt, arg, o, 2)) { err = 1; - fprintf(stderr, "\n%s %d: Unknown option %s", name, line, opt); + fprintf(stderr, "\n%s %d: ¥¼©w¸qªº³]©w %s", name, line, opt); } } break; @@ -631,7 +631,7 @@ /* do nothing */; if (buf[0] != '}') { err = 1; - fprintf(stderr, "\n%s %d: End of joerc file occured before end of help text\n", name, line); + fprintf(stderr, "\n%s %d: ¦]¬° joerc ¤º®e¤¤ªº help(»¡©ú¤å¦r)¦³¤£¥¿±`ªºµ²§ô¡A©Ò¥Hµ²§ô joe ªºÅª¨ú\n", name, line); break; } } @@ -660,11 +660,11 @@ addcmd(buf + x, m); else { err = 1; - fprintf(stderr, "\n%s %d: macro missing from :def", name, line); + fprintf(stderr, "\n%s %d: §ä¤£¨ì¥¨¶° :def", name, line); } } else { err = 1; - fprintf(stderr, "\n%s %d: command name missing from :def", name, line); + fprintf(stderr, "\n%s %d: §ä¤£¨ì«ü¥O :def", name, line); } } else if (!strcmp(buf + 1, "inherit")) if (context) { @@ -675,11 +675,11 @@ kcpy(context, kmap_getcontext(buf + x)); else { err = 1; - fprintf(stderr, "\n%s %d: context name missing from :inherit", name, line); + fprintf(stderr, "\n%s %d: §ä¤£¨ì¤º®e :inherit", name, line); } } else { err = 1; - fprintf(stderr, "\n%s %d: No context selected for :inherit", name, line); + fprintf(stderr, "\n%s %d: ¨S¦³¿ï©w¥ô¦óªº¤º®e :inherit", name, line); } else if (!strcmp(buf + 1, "include")) { for (buf[x] = c; isblank(buf[x]); ++x) ; for (c = x; !isspace_eof(buf[c]); ++c) ; @@ -690,7 +690,7 @@ err = 1; break; case -1: - fprintf(stderr, "\n%s %d: Couldn't open %s", name, line, buf + x); + fprintf(stderr, "\n%s %d: µLªk¶}±Ò %s", name, line, buf + x); err = 1; break; } @@ -698,7 +698,7 @@ o = 0; } else { err = 1; - fprintf(stderr, "\n%s %d: :include missing file name", name, line); + fprintf(stderr, "\n%s %d: : µLªk§ä¨ì¬ÛÃö include ÀÉ", name, line); } } else if (!strcmp(buf + 1, "delete")) if (context) { @@ -711,12 +711,12 @@ kdel(context, buf + x); } else { err = 1; - fprintf(stderr, "\n%s %d: No context selected for :delete", name, line); + fprintf(stderr, "\n%s %d: ¨S¦³¿ï©w¥ô¦óªº¤º®e :delete", name, line); } else context = kmap_getcontext(buf + 1); else { err = 1; - fprintf(stderr, "\n%s %d: Invalid context name", name, line); + fprintf(stderr, "\n%s %d: ¤£¥¿½Tªº¦WºÙ", name, line); } } break; @@ -727,7 +727,7 @@ if (!context) { err = 1; - fprintf(stderr, "\n%s %d: No context selected for macro to key-sequence binding", name, line); + fprintf(stderr, "\n%s %d: ¥¼¿ï©w¥ô¦ó¤º®eµ¹¥¨¶°¨Ï¥Î", name, line); break; } @@ -736,7 +736,7 @@ m = mparse(m, buf, &x); if (x == -1) { err = 1; - fprintf(stderr, "\n%s %d: Unknown command in macro", name, line); + fprintf(stderr, "\n%s %d: ¥¨¶°¤º¦³¥¼ª¾ªºªº«ü¥O", name, line); break; } else if (x == -2) { fgets(buf, 1024, fd); @@ -751,7 +751,7 @@ /* Add binding to context */ if (kadd(cap, context, buf + x, m) == -1) { - fprintf(stderr, "\n%s %d: Bad key sequence '%s'", name, line, buf + x); + fprintf(stderr, "\n%s %d: ¿ù»~ªº«öÁ䶶§Ç³]©w '%s'", name, line, buf + x); err = 1; } } @@ -762,9 +762,9 @@ /* Print proper ending string */ if (err) - fprintf(stderr, "\ndone\n"); + fprintf(stderr, "\n§¹¦¨\n"); else - fprintf(stderr, "done\n"); + fprintf(stderr, "§¹¦¨\n"); return err; /* 0 for success, 1 for syntax error */ } diff -ruN joe-2.9.8/rjoerc.in zh-joe-2.9.8/rjoerc.in --- joe-2.9.8/rjoerc.in Mon Oct 29 22:39:52 2001 +++ zh-joe-2.9.8/rjoerc.in Thu Nov 3 22:57:59 2005 @@ -24,7 +24,7 @@ -marking Text between ^KB and cursor is highlighted (use with -lightoff) - -asis Characters 128 - 255 shown as-is +-asis Characters 128 - 255 shown as-is -force Force final newline when files are saved @@ -414,7 +414,7 @@ Standard JOE user interface quote8 ^\ Enter Meta chars -quote ` Enter Ctrl chars +quote .k; Enter Ctrl chars backs ^? Backspace backs ^H diff -ruN joe-2.9.8/tab.c zh-joe-2.9.8/tab.c --- joe-2.9.8/tab.c Thu Mar 6 15:24:28 2003 +++ zh-joe-2.9.8/tab.c Thu Nov 3 22:57:59 2005 @@ -197,7 +197,7 @@ vsrm(e); tab->pattern = vsncpy(NULL, 0, sc("*")); if (treload(m, 0)) { - msgnw(m->parent, "Couldn't read directory "); + msgnw(m->parent, "µLªkŪ¨ú¥Ø¿ý"); vsrm(tab->pattern); tab->pattern = orgpattern; vsrm(tab->path); @@ -238,7 +238,7 @@ tab->pattern = vsncpy(NULL, 0, sc("*")); if (treload(m, 1)) { - msgnw(m->parent, "Couldn't read directory "); + msgnw(m->parent, "µLªkŪ¨ú¥Ø¿ý"); vsrm(tab->pattern); tab->pattern = orgpattern; vsrm(tab->path); diff -ruN joe-2.9.8/termcap.c zh-joe-2.9.8/termcap.c --- joe-2.9.8/termcap.c Thu Mar 6 15:24:28 2003 +++ zh-joe-2.9.8/termcap.c Thu Nov 3 22:57:57 2005 @@ -223,7 +223,7 @@ joe_free(cap); return 0; */ - fprintf(stderr, "Couldn't load termcap entry. Using ansi default\n"); + fprintf(stderr, "µLªk¸ü¤J termcap¡A¨Ï¥Î ansi ¬°¤º©w­È\n"); ti = 0; cap->tbuf = vsncpy(cap->tbuf, 0, sc(defentry)); goto checktc; diff -ruN joe-2.9.8/tty.c zh-joe-2.9.8/tty.c --- joe-2.9.8/tty.c Thu Mar 6 15:24:29 2003 +++ zh-joe-2.9.8/tty.c Thu Nov 3 22:57:59 2005 @@ -293,7 +293,7 @@ if (!termin) { if (idleout ? (!(termin = stdin) || !(termout = stdout)) : (!(termin = fopen("/dev/tty", "r")) || !(termout = fopen("/dev/tty", "w")))) { - fprintf(stderr, "Couldn\'t open /dev/tty\n"); + fprintf(stderr, "µLªk¶}±Ò /dev/tty\n"); exit(1); } else { #ifdef SIGWINCH @@ -679,7 +679,7 @@ if (cmd) execl(s, s, "-c", cmd, NULL); else { - fprintf(stderr, "You are at the command shell. Type 'exit' to return\n"); + fprintf(stderr, "§A¤w¦b©R©R¦Cªºª¬ºA¤U¡AÁä¤J 'exit' §Y¥iªð¦^ joe\n"); execl(s, s, NULL); } _exit(0); @@ -694,7 +694,7 @@ #ifdef SIGTSTP omode = ttymode; ttclsn(); - fprintf(stderr, "You have suspended the program. Type 'fg' to return\n"); + fprintf(stderr, "§A¤w¸g¼È°±¥Ø«e³o­Ó joe µ{¦¡¡AÁä¤J 'fg' ¥i¥Hªð¦^ joe¡C\n"); kill(0, SIGTSTP); if (ackkbd != -1) kill(kbdpid, SIGCONT); diff -ruN joe-2.9.8/tty.c.orig zh-joe-2.9.8/tty.c.orig --- joe-2.9.8/tty.c.orig Thu Jan 1 08:00:00 1970 +++ zh-joe-2.9.8/tty.c.orig Thu Nov 3 22:57:58 2005 @@ -0,0 +1,1018 @@ +/* + * UNIX Tty and Process interface + * Copyright + * (C) 1992 Joseph H. Allen + * + * This file is part of JOE (Joe's Own Editor) + */ +#include "config.h" +#include "types.h" + +#include +#ifdef HAVE_SYS_STAT_H +#include +#endif +#ifdef GWINSZ_IN_SYS_IOCTL +#ifdef HAVE_SYS_IOCTL_H +#include +#endif +#endif +#include +#ifdef HAVE_FCNTL_H +#include +#endif +#ifdef HAVE_SYS_WAIT_H +#include +#endif +#ifdef HAVE_SYS_PARAM_H +#include +#endif +#include +#include +#include +#include + +int idleout = 1; + +#include "config.h" + +/* We use the defines in sys/ioctl to determine what type + * tty interface the system uses and what type of system + * we actually have. + */ +#ifdef HAVE_POSIX_TERMIOS +# include +# include +#else +# ifdef HAVE_SYSV_TERMIO +# include +# include +# else +# include +# endif +#endif + +#ifdef HAVE_SETITIMER +#ifdef HAVE_SYS_TIME_H +#include +#endif +#endif + +/* I'm not sure if SCO_UNIX and ISC have __svr4__ defined, but I think + they might */ +#ifdef M_SYS5 +#ifndef M_XENIX +#include +#include +#ifndef __svr4__ +#define __svr4__ 1 +#endif +#endif +#endif + +#ifdef ISC +#ifndef __svr4__ +#define __svr4__ 1 +#endif +#endif + +#ifdef __svr4__ +#include +#endif + +/* JOE include files */ + +#include "main.h" +#include "path.h" +#include "tty.h" +#include "utils.h" + +/** Aliased defines **/ + +/* O_NDELAY, O_NONBLOCK, and FNDELAY are all synonyms for placing a descriptor + * in non-blocking mode; we make whichever one we have look like O_NDELAY + */ +#ifndef O_NDELAY +#ifdef O_NONBLOCK +#define O_NDELAY O_NONBLOCK +#endif +#ifdef FNDELAY +#define O_NDELAY FNDELAY +#endif +#endif + +/* Some systems define this, some don't */ +#ifndef sigmask +#define sigmask(x) (1<<((x)-1)) +#endif + +/* Some BSDs don't have TILDE */ +#ifndef TILDE +#define TILDE 0 +#endif + +/* Global configuration variables */ + +int noxon = 0; /* Set if ^S/^Q processing should be disabled */ +int Baud = 0; /* Baud rate from joerc, cmd line or environment */ + +/* The terminal */ + +FILE *termin = NULL; +FILE *termout = NULL; + +/* Original state of tty */ + +#ifdef HAVE_POSIX_TERMIOS +struct termios oldterm; +#else /* HAVE_POSIX_TERMIOS */ +#ifdef HAVE_SYSV_TERMIO +static struct termio oldterm; +#else /* HAVE_SYSV_TERMIO */ +static struct sgttyb oarg; +static struct tchars otarg; +static struct ltchars oltarg; +#endif /* HAVE_SYSV_TERMIO */ +#endif /* HAVE_POSIX_TERMIOS */ + +/* Output buffer, index and size */ + +char *obuf = NULL; +int obufp = 0; +int obufsiz; + +/* The baud rate */ + +unsigned baud; /* Bits per second */ +unsigned long upc; /* Microseconds per character */ + +/* TTY Speed code to baud-rate conversion table (this is dumb- is it really + * too much to ask for them to just use an integer for the baud-rate?) + */ + +static int speeds[] = { + B50, 50, B75, 75, B110, 110, B134, 134, B150, 150, B200, 200, B300, + 300, B600, 600, + B1200, 1200, B1800, 1800, B2400, 2400, B4800, 4800, B9600, 9600 +#ifdef EXTA + , EXTA, 19200 +#endif +#ifdef EXTB + , EXTB, 38400 +#endif +#ifdef B19200 + , B19200, 19200 +#endif +#ifdef B38400 + , B38400, 38400 +#endif +}; + +/* Input buffer */ + +int have = 0; /* Set if we have pending input */ +static unsigned char havec; /* Character read in during pending input check */ +int leave = 0; /* When set, typeahead checking is disabled */ + +/* TTY mode flag. 1 for open, 0 for closed */ +static int ttymode = 0; + +/* Signal state flag. 1 for joe, 0 for normal */ +static int ttysig = 0; + +/* Stuff for shell windows */ + +static pid_t kbdpid; /* PID of kbd client */ +static int ackkbd = -1; /* Editor acks keyboard client to this */ + +static int mpxfd; /* Editor reads packets from this fd */ +static int mpxsfd; /* Clients send packets to this fd */ + +static int nmpx = 0; +static int accept = MAXINT; /* =MAXINT if we have last packet */ + /* FIXME: overloaded meaning of MAXINT */ + +struct packet { + MPX *who; + int size; + int ch; + char data[1024]; +} pack; + +MPX asyncs[NPROC]; + +/* Set signals for JOE */ +void sigjoe(void) +{ + if (ttysig) + return; + ttysig = 1; + joe_set_signal(SIGHUP, ttsig); + joe_set_signal(SIGTERM, ttsig); + joe_set_signal(SIGINT, SIG_IGN); + joe_set_signal(SIGPIPE, SIG_IGN); +} + +/* Restore signals for exiting */ +void signrm(void) +{ + if (!ttysig) + return; + ttysig = 0; + joe_set_signal(SIGHUP, SIG_DFL); + joe_set_signal(SIGTERM, SIG_DFL); + joe_set_signal(SIGINT, SIG_DFL); + joe_set_signal(SIGPIPE, SIG_DFL); +} + +/* Open terminal and set signals */ + +void ttopen(void) +{ + sigjoe(); + ttopnn(); +} + +/* Close terminal and restore signals */ + +void ttclose(void) +{ + ttclsn(); + signrm(); +} + +static int winched = 0; +#ifdef SIGWINCH +/* Window size interrupt handler */ +static RETSIGTYPE winchd(int unused) +{ + ++winched; + REINSTALL_SIGHANDLER(SIGWINCH, winchd); +} +#endif + +/* Second ticker */ + +int ticked = 0; +extern int dostaupd; +static RETSIGTYPE dotick(int unused) +{ + ticked = 1; + dostaupd = 1; +} + +void tickoff(void) +{ + alarm(0); +} + +void tickon(void) +{ + ticked = 0; + joe_set_signal(SIGALRM, dotick); + alarm(1); +} + +/* Open terminal */ + +void ttopnn(void) +{ + int x, bbaud; + +#ifdef HAVE_POSIX_TERMIOS + struct termios newterm; +#else +#ifdef HAVE_SYSV_TERMIO + struct termio newterm; +#else + struct sgttyb arg; + struct tchars targ; + struct ltchars ltarg; +#endif +#endif + + if (!termin) { + if (idleout ? (!(termin = stdin) || !(termout = stdout)) : (!(termin = fopen("/dev/tty", "r")) || !(termout = fopen("/dev/tty", "w")))) { + fprintf(stderr, "Couldn\'t open /dev/tty\n"); + exit(1); + } else { +#ifdef SIGWINCH + joe_set_signal(SIGWINCH, winchd); +#endif + tickon(); + } + } + + if (ttymode) + return; + ttymode = 1; + fflush(termout); + +#ifdef HAVE_POSIX_TERMIOS + tcgetattr(fileno(termin), &oldterm); + newterm = oldterm; + newterm.c_lflag = 0; + if (noxon) + newterm.c_iflag &= ~(ICRNL | IGNCR | INLCR | IXON | IXOFF); + else + newterm.c_iflag &= ~(ICRNL | IGNCR | INLCR); + newterm.c_oflag = 0; + newterm.c_cc[VMIN] = 1; + newterm.c_cc[VTIME] = 0; + tcsetattr(fileno(termin), TCSADRAIN, &newterm); + bbaud = cfgetospeed(&newterm); +#else +#ifdef HAVE_SYSV_TERMIO + ioctl(fileno(termin), TCGETA, &oldterm); + newterm = oldterm; + newterm.c_lflag = 0; + if (noxon) + newterm.c_iflag &= ~(ICRNL | IGNCR | INLCR | IXON | IXOFF); + else + newterm.c_iflag &= ~(ICRNL | IGNCR | INLCR); + newterm.c_oflag = 0; + newterm.c_cc[VMIN] = 1; + newterm.c_cc[VTIME] = 0; + ioctl(fileno(termin), TCSETAW, &newterm); + bbaud = (newterm.c_cflag & CBAUD); +#else + ioctl(fileno(termin), TIOCGETP, &arg); + ioctl(fileno(termin), TIOCGETC, &targ); + ioctl(fileno(termin), TIOCGLTC, <arg); + oarg = arg; + otarg = targ; + oltarg = ltarg; + arg.sg_flags = ((arg.sg_flags & ~(ECHO | CRMOD | XTABS | ALLDELAY | TILDE)) | CBREAK); + if (noxon) { + targ.t_startc = -1; + targ.t_stopc = -1; + } + targ.t_intrc = -1; + targ.t_quitc = -1; + targ.t_eofc = -1; + targ.t_brkc = -1; + ltarg.t_suspc = -1; + ltarg.t_dsuspc = -1; + ltarg.t_rprntc = -1; + ltarg.t_flushc = -1; + ltarg.t_werasc = -1; + ltarg.t_lnextc = -1; + ioctl(fileno(termin), TIOCSETN, &arg); + ioctl(fileno(termin), TIOCSETC, &targ); + ioctl(fileno(termin), TIOCSLTC, <arg); + bbaud = arg.sg_ospeed; +#endif +#endif + + baud = 9600; + upc = 0; + for (x = 0; x != 30; x += 2) + if (bbaud == speeds[x]) { + baud = speeds[x + 1]; + break; + } + if (Baud) + baud = Baud; + upc = DIVIDEND / baud; + if (obuf) + joe_free(obuf); + if (!(TIMES * upc)) + obufsiz = 4096; + else { + obufsiz = 1000000 / (TIMES * upc); + if (obufsiz > 4096) + obufsiz = 4096; + } + if (!obufsiz) + obufsiz = 1; + obuf = (char *) joe_malloc(obufsiz); +} + +/* Close terminal */ + +void ttclsn(void) +{ + int oleave; + + if (ttymode) + ttymode = 0; + else + return; + + oleave = leave; + leave = 1; + + ttflsh(); + +#ifdef HAVE_POSIX_TERMIOS + tcsetattr(fileno(termin), TCSADRAIN, &oldterm); +#else +#ifdef HAVE_SYSV_TERMIO + ioctl(fileno(termin), TCSETAW, &oldterm); +#else + ioctl(fileno(termin), TIOCSETN, &oarg); + ioctl(fileno(termin), TIOCSETC, &otarg); + ioctl(fileno(termin), TIOCSLTC, &oltarg); +#endif +#endif + + leave = oleave; +} + +/* Timer interrupt handler */ + +static int yep; +static RETSIGTYPE dosig(int unused) +{ + yep = 1; +} + +/* FLush output and check for typeahead */ + +#ifdef HAVE_SETITIMER +#ifdef SIG_SETMASK +static void maskit(void) +{ + sigset_t set; + + sigemptyset(&set); + sigaddset(&set, SIGALRM); + sigprocmask(SIG_SETMASK, &set, NULL); +} + +static void unmaskit(void) +{ + sigset_t set; + + sigemptyset(&set); + sigprocmask(SIG_SETMASK, &set, NULL); +} + +static void pauseit(void) +{ + sigset_t set; + + sigemptyset(&set); + sigsuspend(&set); +} + +#else +static void maskit(void) +{ + sigsetmask(sigmask(SIGALRM)); +} + +static void unmaskit(void) +{ + sigsetmask(0); +} + +static void pauseit(void) +{ + sigpause(0); +} + +#endif +#endif + +int ttflsh(void) +{ + /* Flush output */ + if (obufp) { + unsigned long usec = obufp * upc; /* No. usecs this write should take */ + +#ifdef HAVE_SETITIMER + if (usec >= 50000 && baud < 9600) { + struct itimerval a, b; + + a.it_value.tv_sec = usec / 1000000; + a.it_value.tv_usec = usec % 1000000; + a.it_interval.tv_usec = 0; + a.it_interval.tv_sec = 0; + alarm(0); + joe_set_signal(SIGALRM, dosig); + yep = 0; + maskit(); + setitimer(ITIMER_REAL, &a, &b); + joe_write(fileno(termout), obuf, obufp); + while (!yep) + pauseit(); + unmaskit(); + tickon(); + } else + joe_write(fileno(termout), obuf, obufp); + +#else + + joe_write(fileno(termout), obuf, obufp); + +#ifdef FIORDCHK + if (baud < 9600 && usec / 1000) + nap(usec / 1000); +#endif + +#endif + + obufp = 0; + } + + /* Ack previous packet */ + if (ackkbd != -1 && accept != MAXINT && !have) { + char c = 0; + + if (pack.who && pack.who->func) + joe_write(pack.who->ackfd, &c, 1); + else + joe_write(ackkbd, &c, 1); + accept = MAXINT; + } + + /* Check for typeahead or next packet */ + + if (!have && !leave) { + if (ackkbd != -1) { + fcntl(mpxfd, F_SETFL, O_NDELAY); + if (read(mpxfd, &pack, sizeof(struct packet) - 1024) > 0) { + fcntl(mpxfd, F_SETFL, 0); + joe_read(mpxfd, pack.data, pack.size); + have = 1; + accept = pack.ch; + } else + fcntl(mpxfd, F_SETFL, 0); + } else { + /* Set terminal input to non-blocking */ + fcntl(fileno(termin), F_SETFL, O_NDELAY); + + /* Try to read */ + if (read(fileno(termin), &havec, 1) == 1) + have = 1; + + /* Set terminal back to blocking */ + fcntl(fileno(termin), F_SETFL, 0); + } + } + return 0; +} + +/* Read next character from input */ + +void mpxdied(MPX *m); + +int ttgetc(void) +{ + int stat; + + loop: + ttflsh(); + while (winched) { + winched = 0; + edupd(1); + ttflsh(); + } + if (ticked) { + edupd(0); + ttflsh(); + tickon(); + } + if (ackkbd != -1) { + if (!have) { /* Wait for input */ + stat = read(mpxfd, &pack, sizeof(struct packet) - 1024); + + if (pack.size && stat > 0) { + joe_read(mpxfd, pack.data, pack.size); + } else if (stat < 1) { + if (winched || ticked) + goto loop; + else + ttsig(0); + } + accept = pack.ch; + } + have = 0; + if (pack.who) { /* Got bknd input */ + if (accept != MAXINT) { + if (pack.who->func) { + pack.who->func(pack.who->object, pack.data, pack.size); + edupd(1); + } + } else + mpxdied(pack.who); + goto loop; + } else { + if (accept != MAXINT) + return accept; + else { + ttsig(0); + return 0; + } + } + } + if (have) { + have = 0; + } else { + if (read(fileno(termin), &havec, 1) < 1) { + if (winched || ticked) + goto loop; + else + ttsig(0); + } + } + return havec; +} + +/* Write string to output */ + +void ttputs(char *s) +{ + while (*s) { + obuf[obufp++] = *s++; + if (obufp == obufsiz) + ttflsh(); + } +} + +/* Get window size */ + +void ttgtsz(int *x, int *y) +{ +#ifdef TIOCGSIZE + struct ttysize getit; +#else +#ifdef TIOCGWINSZ + struct winsize getit; +#endif +#endif + + *x = 0; + *y = 0; + +#ifdef TIOCGSIZE + if (ioctl(fileno(termout), TIOCGSIZE, &getit) != -1) { + *x = getit.ts_cols; + *y = getit.ts_lines; + } +#else +#ifdef TIOCGWINSZ + if (ioctl(fileno(termout), TIOCGWINSZ, &getit) != -1) { + *x = getit.ws_col; + *y = getit.ws_row; + } +#endif +#endif +} + +void ttshell(char *cmd) +{ + int x, omode = ttymode; + char *s = getenv("SHELL"); + + if (!s) + return; + ttclsn(); + if ((x = fork()) != 0) { + if (x != -1) + wait(NULL); + if (omode) + ttopnn(); + } else { + signrm(); + if (cmd) + execl(s, s, "-c", cmd, NULL); + else { + fprintf(stderr, "You are at the command shell. Type 'exit' to return\n"); + execl(s, s, NULL); + } + _exit(0); + } +} + +void ttsusp(void) +{ + int omode; + + tickoff(); +#ifdef SIGTSTP + omode = ttymode; + ttclsn(); + fprintf(stderr, "You have suspended the program. Type 'fg' to return\n"); + kill(0, SIGTSTP); + if (ackkbd != -1) + kill(kbdpid, SIGCONT); + if (omode) + ttopnn(); +#else + ttshell(NULL); +#endif + tickon(); +} + +static void mpxstart(void) +{ + int fds[2]; + + pipe(fds); + mpxfd = fds[0]; + mpxsfd = fds[1]; + pipe(fds); + accept = MAXINT; + have = 0; + if (!(kbdpid = fork())) { + close(fds[1]); + do { + unsigned char c; + int sta; + + pack.who = 0; + sta = joe_read(fileno(termin), &c, 1); + if (sta == 0) + pack.ch = MAXINT; + else + pack.ch = c; + pack.size = 0; + joe_write(mpxsfd, &pack, sizeof(struct packet) - 1024); + } while (joe_read(fds[0], &pack, 1) == 1); + _exit(0); + } + close(fds[0]); + ackkbd = fds[1]; +} + +static void mpxend(void) +{ + kill(kbdpid, 9); + while (wait(NULL) < 0 && errno == EINTR) + /* do nothing */; + close(ackkbd); + ackkbd = -1; + close(mpxfd); + close(mpxsfd); + if (have) + havec = pack.ch; +} + +/* Get a pty/tty pair. Returns open pty in 'ptyfd' and returns tty name + * string in static buffer or NULL if couldn't get a pair. + */ + +#ifdef sgi + +/* Newer sgi machines can do it the __svr4__ way, but old ones can't */ + +extern char *_getpty(); + +static char *getpty(int *ptyfd) +{ + return _getpty(ptyfd, O_RDWR, 0600, 0); +} + +#else +#ifdef __svr4__ + +/* Strange streams way */ + +extern char *ptsname(); + +static char *getpty(int *ptyfd) +{ + int fdm; + char *name; + + *ptyfd = fdm = open("/dev/ptmx", O_RDWR); + grantpt(fdm); + unlockpt(fdm); + return ptsname(fdm); +} + +#else + +/* The normal way: for each possible pty/tty pair, try to open the pty and + * then the corresponding tty. If both could be opened, close them both and + * then re-open the pty. If that succeeded, return with the opened pty and the + * name of the tty. + * + * Logically you should only have to succeed in opening the pty- but the + * permissions may be set wrong on the tty, so we have to try that too. + * We close them both and re-open the pty because we want the forked process + * to open the tty- that way it gets to be the controlling tty for that + * process and the process gets to be the session leader. + */ + +static char *getpty(int *ptyfd) +{ + int x, fd; + char *orgpwd = pwd(); + static char **ptys = NULL; + static char *ttydir; + static char *ptydir; + static char ttyname[32]; + + if (!ptys) { + ttydir = "/dev/pty/"; + ptydir = "/dev/ptym/"; /* HPUX systems */ + if (chpwd(ptydir) || !(ptys = rexpnd("pty*"))) + if (!ptys) { + ttydir = ptydir = "/dev/"; /* Everyone else */ + if (!chpwd(ptydir)) + ptys = rexpnd("pty*"); + } + } + chpwd(orgpwd); + + if (ptys) + for (fd = 0; ptys[fd]; ++fd) { + strcpy(ttyname, ptydir); + strcat(ttyname, ptys[fd]); + if ((*ptyfd = open(ttyname, O_RDWR)) >= 0) { + ptys[fd][0] = 't'; + strcpy(ttyname, ttydir); + strcat(ttyname, ptys[fd]); + ptys[fd][0] = 'p'; + x = open(ttyname, O_RDWR); + if (x >= 0) { + close(x); + close(*ptyfd); + strcpy(ttyname, ptydir); + strcat(ttyname, ptys[fd]); + *ptyfd = open(ttyname, O_RDWR); + ptys[fd][0] = 't'; + strcpy(ttyname, ttydir); + strcat(ttyname, ptys[fd]); + ptys[fd][0] = 'p'; + return ttyname; + } else + close(*ptyfd); + } + } + return NULL; +} + +#endif +#endif + +int dead = 0; + +static RETSIGTYPE death(int unused) +{ + wait(NULL); + dead = 1; +} + +#ifndef SIGCHLD +#define SIGCHLD SIGCLD +#endif + +/* Build a new environment */ + +extern char **mainenv; + +static char **newenv(char **old, char *s) +{ + char **new; + int x, y, z; + + for (x = 0; old[x]; ++x) ; + new = (char **) joe_malloc((x + 2) * sizeof(char *)); + + for (x = 0, y = 0; old[x]; ++x) { + for (z = 0; s[z] != '='; ++z) + if (s[z] != old[x][z]) + break; + if (s[z] == '=') { + if (s[z + 1]) + new[y++] = s; + } else + new[y++] = old[x]; + } + if (x == y) + new[y++] = s; + new[y] = 0; + return new; +} + +MPX *mpxmk(int *ptyfd, char *cmd, char **args, void (*func) (/* ??? */), void *object, void (*die) (/* ??? */), void *dieobj) +{ + int fds[2]; + int comm[2]; + pid_t pid; + int x; + MPX *m; + char *name; + + if (!(name = getpty(ptyfd))) + return NULL; + for (x = 0; x != NPROC; ++x) + if (!asyncs[x].func) { + m = asyncs + x; + goto ok; + } + return NULL; + ok: + ttflsh(); + ++nmpx; + if (ackkbd == -1) + mpxstart(); + m->func = func; + m->object = object; + m->die = die; + m->dieobj = dieobj; + pipe(fds); + pipe(comm); + m->ackfd = fds[1]; + if (!(m->kpid = fork())) { + close(fds[1]); + close(comm[0]); + dead = 0; + joe_set_signal(SIGCHLD, death); + + if (!(pid = fork())) { + signrm(); + close(*ptyfd); + +#ifdef TIOCNOTTY + x = open("/dev/tty", O_RDWR); + ioctl(x, TIOCNOTTY, 0); +#endif + +#ifndef SETPGRP_VOID + setpgrp(0, 0); +#else + setpgrp(); +#endif + + for (x = 0; x != 32; ++x) + close(x); /* Yes, this is quite a kludge... all in the + name of portability */ + + if ((x = open(name, O_RDWR)) != -1) { /* Standard input */ + char **env = newenv(mainenv, "TERM="); + +#ifdef __svr4__ + ioctl(x, I_PUSH, "ptem"); + ioctl(x, I_PUSH, "ldterm"); +#endif + dup(x); + dup(x); /* Standard output, standard error */ + /* (yes, stdin, stdout, and stderr must all be open for reading and + * writing. On some systems the shell assumes this */ + + /* We could probably have a special TTY set-up for JOE, but for now + * we'll just use the TTY setup for the TTY was was run on */ +#ifdef HAVE_POSIX_TERMIOS + tcsetattr(0, TCSADRAIN, &oldterm); +#else +#ifdef HAVE_SYSV_TERMIO + ioctl(0, TCSETAW, &oldterm); +#else + ioctl(0, TIOCSETN, &oarg); + ioctl(0, TIOCSETC, &otarg); + ioctl(0, TIOCSLTC, &oltarg); +#endif +#endif + + /* Execute the shell */ + execve(cmd, args, env); + } + + _exit(0); + } + joe_write(comm[1], &pid, sizeof(pid)); + + loop: + pack.who = m; + pack.ch = 0; + if (dead) + pack.size = 0; + else + pack.size = read(*ptyfd, pack.data, 1024); + if (pack.size > 0) { + joe_write(mpxsfd, &pack, sizeof(struct packet) - 1024 + pack.size); + + joe_read(fds[0], &pack, 1); + goto loop; + } else { + pack.ch = MAXINT; + pack.size = 0; + joe_write(mpxsfd, &pack, sizeof(struct packet) - 1024); + + _exit(0); + } + } + joe_read(comm[0], &m->pid, sizeof(m->pid)); + + close(comm[0]); + close(comm[1]); + close(fds[0]); + return m; +} + +void mpxdied(MPX *m) +{ + if (!--nmpx) + mpxend(); + while (wait(NULL) < 0 && errno == EINTR) + /* do nothing */; + if (m->die) + m->die(m->dieobj); + m->func = NULL; + edupd(1); +} diff -ruN joe-2.9.8/tw.c zh-joe-2.9.8/tw.c --- joe-2.9.8/tw.c Thu Mar 6 15:24:29 2003 +++ zh-joe-2.9.8/tw.c Thu Nov 3 22:57:59 2005 @@ -122,15 +122,15 @@ stalin = vsadd(stalin, fill); break; case 'n': - stalin = vsncpy(sv(stalin), sz(bw->b->name ? bw->b->name : "Unnamed")); + stalin = vsncpy(sv(stalin), sz(bw->b->name ? bw->b->name : "¥¼©R¦W")); break; case 'm': if (bw->b->changed) - stalin = vsncpy(sv(stalin), sc("(Modified)")); + stalin = vsncpy(sv(stalin), sc("(¤w§ó§ï)")); break; case 'R': if (bw->b->rdonly) - stalin = vsncpy(sv(stalin), sc("(Read only)")); + stalin = vsncpy(sv(stalin), sc("(°ßŪ)")); break; case '*': if (bw->b->changed) @@ -238,7 +238,7 @@ break; case 'M': if (recmac) { - snprintf(buf, sizeof(buf), "(Macro %d recording...)", recmac->n); + snprintf(buf, sizeof(buf), "(¥¨¶° %d ¿ý»s¤¤...)", recmac->n); stalin = vsncpy(sv(stalin), sz(buf)); } break; @@ -433,7 +433,7 @@ if (bw->pid) return ukillpid(bw); if (bw->b->changed && bw->b->count == 1) - if (mkqw(bw->parent, sc("Lose changes to this file (y,n,^C)? "), naborttw, NULL, NULL, NULL)) + if (mkqw(bw->parent, sc("©ñ±ó¹ï³o­ÓÀɮתº§ó§ï (y,n,^C)? "), naborttw, NULL, NULL, NULL)) return 0; else return -1; @@ -501,7 +501,7 @@ if (t->curwin->main != mainw) { BW *bw = t->curwin->main->object; if (bw->pid) { - msgnw(bw->parent, "Process running in this window"); + msgnw(bw->parent, "µøµ¡¤¤¥¿¦³µ{¦¡°õ¦æ¤¤"); return -1; } utw0((BASE *)bw); diff -ruN joe-2.9.8/ublock.c zh-joe-2.9.8/ublock.c --- joe-2.9.8/ublock.c Thu Mar 6 15:24:29 2003 +++ zh-joe-2.9.8/ublock.c Thu Nov 3 22:57:57 2005 @@ -351,7 +351,7 @@ if (lightoff) unmark(bw); } else { - msgnw(bw->parent, "No block"); + msgnw(bw->parent, "©|¥¼¿ï¨ú°Ï¶ô"); return -1; } return 0; @@ -388,7 +388,7 @@ { if (markv(1)) { if (markb->b->rdonly) { - msgnw(bw->parent, "Read only"); + msgnw(bw->parent, "°ßŪ"); return -1; } if (square) { @@ -439,7 +439,7 @@ return 0; } } - msgnw(bw->parent, "No block"); + msgnw(bw->parent, "©|¥¼¿ï¨ú°Ï¶ô"); return -1; } @@ -483,7 +483,7 @@ return 0; } } else { - msgnw(bw->parent, "No block"); + msgnw(bw->parent, "©|¥¼¿ï¨ú°Ï¶ô"); return -1; } } @@ -527,7 +527,7 @@ } } else { vsrm(s); - msgnw(bw->parent, "No block"); + msgnw(bw->parent, "©|¥¼¿ï¨ú°Ï¶ô"); return -1; } } @@ -721,7 +721,7 @@ updall(); return 0; } else { - msgnw(bw->parent, "No block"); + msgnw(bw->parent, "©|¥¼¿ï¨ú°Ï¶ô"); return -1; } else { int ret = 0; @@ -753,7 +753,7 @@ if (markb && markk && !square && markb->b == bw->b && markk->b == bw->b && markb->byte == markk->byte) goto ok; if (!markv(1)) { - msgnw(bw->parent, "No block"); + msgnw(bw->parent, "©|¥¼¿ï¨ú°Ï¶ô"); return -1; } ok: @@ -873,23 +873,23 @@ int ufilt(BW *bw) { #ifdef __MSDOS__ - msgnw(bw->parent, "Sorry, no sub-processes in DOS (yet)"); + msgnw(bw->parent, "¹ï¤£°_!¦b MS-DOS ¤U¤£¯à¥t¥~¦A°õ¦æ¤l¦æµ{!"); return -1; #else switch (checkmark(bw)) { case 0: - if (wmkpw(bw->parent, "Command to filter block through (^C to abort): ", &filthist, dofilt, NULL, NULL, utypebw, NULL, NULL)) + if (wmkpw(bw->parent, "¥Î¨Ó¹LÂo°Ï¶ôªº©R¥O¦WºÙ (^C ¤¤Â_): ", &filthist, dofilt, NULL, NULL, utypebw, NULL, NULL)) return 0; else return -1; case 1: - if (wmkpw(bw->parent, "Command to filter file through (^C to abort): ", &filthist, dofilt, NULL, NULL, utypebw, NULL, NULL)) + if (wmkpw(bw->parent, "¥Î¨Ó¹LÂo°Ï¶ôªº©R¥O¦WºÙ (^C ¤¤Â_): ", &filthist, dofilt, NULL, NULL, utypebw, NULL, NULL)) return 0; else return -1; case 2: default: - msgnw(bw->parent, "No block"); + msgnw(bw->parent, "©|¥¼¿ï¨ú°Ï¶ô"); return -1; } #endif diff -ruN joe-2.9.8/uedit.c zh-joe-2.9.8/uedit.c --- joe-2.9.8/uedit.c Thu Mar 6 15:24:29 2003 +++ zh-joe-2.9.8/uedit.c Thu Nov 3 22:57:58 2005 @@ -514,14 +514,14 @@ if (merr) msgnw(bw->parent, merr); else - msgnw(bw->parent, "Invalid line number"); + msgnw(bw->parent, "¤£¥¿½Tªº¦æ¼Æ"); return -1; } } int uline(BW *bw) { - if (wmkpw(bw->parent, "Go to line (^C to abort): ", &linehist, doline, NULL, NULL, NULL, NULL, NULL)) + if (wmkpw(bw->parent, "¸õ¨ì²Ä´X¦æ (^C ¤¤Â_): ", &linehist, doline, NULL, NULL, NULL, NULL, NULL)) return 0; else return -1; @@ -550,14 +550,14 @@ if (merr) msgnw(bw->parent, merr); else - msgnw(bw->parent, "Invalid column number"); + msgnw(bw->parent, "¤£¥¿½Tªº¦C¼Æ"); return -1; } } int ucol(BW *bw) { - if (wmkpw(bw->parent, "Go to column (^C to abort): ", &colhist, docol, NULL, NULL, NULL, NULL, NULL)) + if (wmkpw(bw->parent, "¸õ¨ì²Ä´X¦C (^C ¤¤Â_): ", &colhist, docol, NULL, NULL, NULL, NULL, NULL)) return 0; else return -1; @@ -586,14 +586,14 @@ if (merr) msgnw(bw->parent, merr); else - msgnw(bw->parent, "Invalid byte number"); + msgnw(bw->parent, "¤£¥¿½Tªº¦ì¤¸¼Æ"); return -1; } } int ubyte(BW *bw) { - if (wmkpw(bw->parent, "Go to byte (^C to abort): ", &bytehist, dobyte, NULL, NULL, NULL, NULL, NULL)) + if (wmkpw(bw->parent, "¸õ¨ì²Ä´X¦ì¤¸ (^C ¤¤Â_): ", &bytehist, dobyte, NULL, NULL, NULL, NULL, NULL)) return 0; else return -1; @@ -971,7 +971,7 @@ int uquote(BW *bw) { quotestate = 0; - if (mkqwna(bw->parent, sc("Ctrl- (or 0-9 for dec. ascii, x for hex, or o for octal)"), doquote, NULL, NULL, NULL)) + if (mkqwna(bw->parent, sc("Ctrl- ( asci 0-9 ¤Q¶i¦ì, x ¤Q¤»¶i¦ì, o ¤K¶i¦ì)"), doquote, NULL, NULL, NULL)) return 0; else return -1; @@ -1089,7 +1089,7 @@ if (c >= '0' && c <= '9') { pdupown(bw->cursor, bw->b->marks + c - '0'); poffline(bw->b->marks[c - '0']); - snprintf(msgbuf, JOE_MSGBUFSIZE, "Mark %d set", c - '0'); + snprintf(msgbuf, JOE_MSGBUFSIZE, "³]©w²Ä %d ¼Ð°O", c - '0'); msgnw(bw->parent, msgbuf); return 0; } else { @@ -1102,7 +1102,7 @@ { if (c >= '0' && c <= '9') return dosetmark(bw, c, NULL, NULL); - else if (mkqwna(bw->parent, sc("Set mark (0-9):"), dosetmark, NULL, NULL, NULL)) + else if (mkqwna(bw->parent, sc("³]©w¼Ð°O (0-9):"), dosetmark, NULL, NULL, NULL)) return 0; else return -1; @@ -1120,7 +1120,7 @@ bw->cursor->xcol = piscol(bw->cursor); return 0; } else { - snprintf(msgbuf, JOE_MSGBUFSIZE, "Mark %d not set", c - '0'); + snprintf(msgbuf, JOE_MSGBUFSIZE, "¼Ð°O %d ¨S¦³³]©w§¹¦¨", c - '0'); msgnw(bw->parent, msgbuf); return -1; } else { @@ -1133,7 +1133,7 @@ { if (c >= '0' && c <= '9') return dogomark(bw, c, NULL, NULL); - else if (mkqwna(bw->parent, sc("Goto bookmark (0-9):"), dogomark, NULL, NULL, NULL)) + else if (mkqwna(bw->parent, sc("¸õ¨ì²Ä´X®ÑÅÒ (0-9):"), dogomark, NULL, NULL, NULL)) return 0; else return -1; @@ -1165,7 +1165,7 @@ break; } if (c == NO_MORE_DATA) { - msgnw(bw->parent, "Not found"); + msgnw(bw->parent, "§ä¤£¨ì"); prm(q); return -1; } else { @@ -1212,7 +1212,7 @@ int umsg(BASE *b) { - if (wmkpw(b->parent, "Msg (^C to abort): ", NULL, domsg, NULL, NULL, NULL, NULL, NULL)) + if (wmkpw(b->parent, "°T®§ (^C ¤¤Â_): ", NULL, domsg, NULL, NULL, NULL, NULL, NULL)) return 0; else return -1; @@ -1234,7 +1234,7 @@ int utxt(BASE *bw) { - if (wmkpw(bw->parent, "Insert (^C to abort): ", NULL, dotxt, NULL, NULL, utypebw, NULL, NULL)) + if (wmkpw(bw->parent, "´¡¤J (^C ¤¤Â_): ", NULL, dotxt, NULL, NULL, utypebw, NULL, NULL)) return 0; else return -1; diff -ruN joe-2.9.8/uerror.c zh-joe-2.9.8/uerror.c --- joe-2.9.8/uerror.c Thu Mar 6 15:24:29 2003 +++ zh-joe-2.9.8/uerror.c Thu Nov 3 22:57:59 2005 @@ -191,7 +191,7 @@ { errbuf = bw->b; freeall(); - snprintf(msgbuf, JOE_MSGBUFSIZE, "Parsed %ld lines", parserr(bw->b)); + snprintf(msgbuf, JOE_MSGBUFSIZE, "Åã¥Ü²Ä %ld ¦æ", parserr(bw->b)); msgnw(bw->parent, msgbuf); return 0; } @@ -201,7 +201,7 @@ int omid; if (errptr->link.next == &errors) { - msgnw(bw->parent, "No more errors"); + msgnw(bw->parent, "¿ù»~Åã¥Ü§¹²¦"); return -1; } errptr = errptr->link.next; @@ -226,7 +226,7 @@ int omid; if (errptr->link.prev == &errors) { - msgnw(bw->parent, "No more errors"); + msgnw(bw->parent, "¿ù»~Åã¥Ü§¹²¦"); return -1; } errptr = errptr->link.prev; diff -ruN joe-2.9.8/ufile.c zh-joe-2.9.8/ufile.c --- joe-2.9.8/ufile.c Thu Mar 6 15:24:29 2003 +++ zh-joe-2.9.8/ufile.c Thu Nov 3 22:57:57 2005 @@ -69,37 +69,37 @@ if (bw->b->name && bw->b->name[0]) { s = bw->b->name; } else { - s = "(Unnamed)"; + s = "(¥¼©R¦W)"; } if (name) { if (saved) { - snprintf(msgbuf, JOE_MSGBUFSIZE, "File %s saved", name); + snprintf(msgbuf, JOE_MSGBUFSIZE, "ÀɮסG %s ¦sÀɧ¹²¦¡C", name); } else { - snprintf(msgbuf, JOE_MSGBUFSIZE, "File %s not saved", name); + snprintf(msgbuf, JOE_MSGBUFSIZE, "ÀɮסG %s ¨Ã¥¼Àx¦s¡C", name); } } else if (bw->b->changed && bw->b->count == 1) { - snprintf(msgbuf, JOE_MSGBUFSIZE, "File %s not saved", s); + snprintf(msgbuf, JOE_MSGBUFSIZE, "ÀɮסG %s ¨Ã¥¼Àx¦s¡C", s); } else if (saved) { - snprintf(msgbuf, JOE_MSGBUFSIZE, "File %s saved", s); + snprintf(msgbuf, JOE_MSGBUFSIZE, "ÀɮסG %s ¤w¸gÀx¦s¡C", s); } else { - snprintf(msgbuf, JOE_MSGBUFSIZE, "File %s not changed so no update needed", s); + snprintf(msgbuf, JOE_MSGBUFSIZE, "ÀÉ®× %s ¨Ã¥¼§ïÅÜ¡A©Ò¥H¤£»Ý­n§ó·s¸ê®Æ¡C", s); } msgnw(bw->parent, msgbuf); if (!exmsg) { if (bw->b->changed && bw->b->count == 1) { - exmsg = vsncpy(NULL, 0, sc("File ")); + exmsg = vsncpy(NULL, 0, sc("ÀÉ®× ")); exmsg = vsncpy(sv(exmsg), sz(s)); - exmsg = vsncpy(sv(exmsg), sc(" not saved.")); + exmsg = vsncpy(sv(exmsg), sc(" ¨Ã¥¼Àx¦s¡C")); } else if (saved) { - exmsg = vsncpy(NULL, 0, sc("File ")); + exmsg = vsncpy(NULL, 0, sc("ÀÉ®× ")); exmsg = vsncpy(sv(exmsg), sz(s)); - exmsg = vsncpy(sv(exmsg), sc(" saved.")); + exmsg = vsncpy(sv(exmsg), sc(" ¦sÀɧ¹²¦¡C")); } else { - exmsg = vsncpy(NULL, 0, sc("File ")); + exmsg = vsncpy(NULL, 0, sc("ÀÉ®× ")); exmsg = vsncpy(sv(exmsg), sz(s)); - exmsg = vsncpy(sv(exmsg), sc(" not changed so no update needed.")); + exmsg = vsncpy(sv(exmsg), sc(" ¨Ã¥¼§ïÅÜ¡A©Ò¥H¤£»Ý­n§ó·s¸ê®Æ¡C")); } } } @@ -109,7 +109,7 @@ int ublksave(BW *bw) { if (markb && markk && markb->b == markk->b && (markk->byte - markb->byte) > 0 && (!square || piscol(markk) > piscol(markb))) { - if (wmkpw(bw->parent, "Name of file to write (^C to abort): ", &filehist, dowrite, "Names", NULL, cmplt, NULL, NULL)) { + if (wmkpw(bw->parent, "­nÀx¦sªºÀɦW (^C ¤¤Â_): ", &filehist, dowrite, "Names", NULL, cmplt, NULL, NULL)) { return 0; } else { return -1; @@ -260,7 +260,7 @@ if (notify) { *notify = 1; } - msgnw(bw->parent, "Couldn't make backup file... file not saved"); + msgnw(bw->parent, "µLªk²£¥Í³Æ¥÷ÀÉ... Àɮרå¼Àx¦s¡C"); if (callback) { return callback(bw, -1); } else { @@ -268,7 +268,7 @@ } } if (c != 'y' && c != 'Y') { - if (mkqw(bw->parent, sc("Could not make backup file. Save anyway (y,n,^C)? "), saver, NULL, req, notify)) { + if (mkqw(bw->parent, sc("µLªk²£¥Í³Æ¥÷ÀÉ¡C µL½×¦p¦ó³£­nÀx¦s (y,n,^C)? "), saver, NULL, req, notify)) { return 0; } else { if (notify) @@ -356,7 +356,7 @@ genexmsg(bw, 0, s); vsrm(s); return -1; - } else if (mkqw(bw->parent, sc("File exists. Overwrite (y,n,^C)? "), dosave2, NULL, s, notify)) { + } else if (mkqw(bw->parent, sc("Àɮפw¸g¦s¦b¡C ­nÂл\\ÂÂÀɶÜ?(y,n,^C) "), dosave2, NULL, s, notify)) { return 0; } else { return -1; @@ -381,7 +381,7 @@ { BW *pbw; - pbw = wmkpw(bw->parent, "Name of file to save (^C to abort): ", &filehist, dosave1, "Names", NULL, cmplt, NULL, NULL); + pbw = wmkpw(bw->parent, "­nÀx¦sªºÀɮצWºÙ (^C ¤¤Â_): ", &filehist, dosave1, "Names", NULL, cmplt, NULL, NULL); if (pbw && bw->b->name) { binss(pbw->cursor, bw->b->name); @@ -409,7 +409,7 @@ *notify = 1; } if (bw->pid) { - msgnw(bw->parent, "Process running in this window"); + msgnw(bw->parent, "µøµ¡¤¤¦³µ{¦¡¥¿¦b°õ¦æ¤¤"); return -1; } b = bfind(s); @@ -450,7 +450,7 @@ int okrepl(BW *bw) { if (bw->b->count == 1 && bw->b->changed) { - msgnw(bw->parent, "Can't replace modified file"); + msgnw(bw->parent, "µLªk¨ú¥N¤w§ó§ï¹LªºÀɮסC"); return -1; } else { return 0; @@ -459,7 +459,7 @@ int uedit(BW *bw) { - if (wmkpw(bw->parent, "Name of file to edit (^C to abort): ", &filehist, doedit, "Names", NULL, cmplt, NULL, NULL)) { + if (wmkpw(bw->parent, "±ý½s¿èªºÀɮצWºÙ (^C ¤¤Â_): ", &filehist, doedit, "Names", NULL, cmplt, NULL, NULL)) { return 0; } else { return -1; @@ -480,7 +480,7 @@ *notify = 1; } if (bw->pid) { - msgnw(bw->parent, "Process running in this window"); + msgnw(bw->parent, "µøµ¡¤¤¦³µ{¦¡¥¿¦b°õ¦æ¤¤"); return -1; } b = bfind(s); @@ -517,7 +517,7 @@ B *b; if (bw->pid) { - msgnw(bw->parent, "Process running in this window"); + msgnw(bw->parent, "µøµ¡¤¤¦³µ{¦¡¥¿¦b°õ¦æ¤¤"); return -1; } b = bnext(); @@ -549,7 +549,7 @@ B *b; if (bw->pid) { - msgnw(bw->parent, "Process running in this window"); + msgnw(bw->parent, "µøµ¡¤¤¦³µ{¦¡¥¿¦b°õ¦æ¤¤"); return -1; } b = bprev(); @@ -576,7 +576,7 @@ int uinsf(BW *bw) { - if (wmkpw(bw->parent, "Name of file to insert (^C to abort): ", &filehist, doinsf, "Names", NULL, cmplt, NULL, NULL)) { + if (wmkpw(bw->parent, "±ý´¡¤JªºÀɮצWºÙ (^C ¤¤Â_): ", &filehist, doinsf, "Names", NULL, cmplt, NULL, NULL)) { return 0; } else { return -1; @@ -624,7 +624,7 @@ } else if (bw->b->name && !exask) { return dosave(bw, vsncpy(NULL, 0, sz(bw->b->name)), exdone1, NULL); } else { - BW *pbw = wmkpw(bw->parent, "Name of file to save (^C to abort): ", &filehist, doex, "Names", NULL, cmplt, NULL, NULL); + BW *pbw = wmkpw(bw->parent, "±ýÀx¦sªºÀɮצWºÙ (^C ¤¤Â_): ", &filehist, doex, "Names", NULL, cmplt, NULL, NULL); if (pbw && bw->b->name) { binss(pbw->cursor, bw->b->name); @@ -647,7 +647,7 @@ if (bw->b->name) { return dosave1(bw, vsncpy(NULL, 0, sz(bw->b->name)), object, notify); } else { - BW *pbw = wmkpw(bw->parent, "Name of file to save (^C to abort): ", &filehist, dosave1, "Names", NULL, cmplt, object, notify); + BW *pbw = wmkpw(bw->parent, "±ýÀx¦sªºÀɮצWºÙ (^C ¤¤Â_): ", &filehist, dosave1, "Names", NULL, cmplt, object, notify); if (pbw) { return 0; @@ -662,7 +662,7 @@ } return 0; } else if (bw->b->count == 1 && bw->b->changed) { - if (mkqw(bw->parent, sc("Save changes to this file (y,n,^C)? "), nask, NULL, object, notify)) { + if (mkqw(bw->parent, sc("­nÀx¦s¹ï³oÀɮתº§ó§ï¶Ü?(y,n,^C) "), nask, NULL, object, notify)) { return 0; } else { return -1; @@ -687,7 +687,7 @@ static int nask2(BW *bw, int c, void *object, int *notify) { if (c == 'y' || c == 'Y') { - BW *pbw = wmkpw(bw->parent, "Name of file to save (^C to abort): ", &filehist, dosave1, "Names", NULL, cmplt, object, notify); + BW *pbw = wmkpw(bw->parent, "±ýÀx¦sªºÀɮצWºÙ (^C ¤¤Â_): ", &filehist, dosave1, "Names", NULL, cmplt, object, notify); if (pbw) { return 0; @@ -701,7 +701,7 @@ } return 0; } else if (bw->b->count == 1 && bw->b->changed) { - if (mkqw(bw->parent, sc("Save changes to this file (y,n,^C)? "), nask, NULL, object, notify)) { + if (mkqw(bw->parent, sc("­nÀx¦s¹ï³oÀɮתº§ó§ï¶Ü (y,n,^C)? "), nask, NULL, object, notify)) { return 0; } else { return -1; @@ -755,7 +755,7 @@ return ukillpid(bw); } if (bw->b->count == 1 && bw->b->changed) { - if (mkqw(bw->parent, sc("Lose changes to this file (y,n,^C)? "), dolose, NULL, NULL, NULL)) { + if (mkqw(bw->parent, sc("©ñ±ó¹ï³oÀɮתº§ó§ï¶Ü (y,n,^C)? "), dolose, NULL, NULL, NULL)) { return 0; } else { return -1; diff -ruN joe-2.9.8/uisrch.c zh-joe-2.9.8/uisrch.c --- joe-2.9.8/uisrch.c Thu Mar 6 15:24:29 2003 +++ zh-joe-2.9.8/uisrch.c Thu Nov 3 22:57:59 2005 @@ -154,7 +154,7 @@ struct isrch *isrch = (struct isrch *) joe_malloc(sizeof(struct isrch)); izque(IREC, link, &isrch->irecs); - isrch->pattern = vsncpy(NULL, 0, sc("I-find: ")); + isrch->pattern = vsncpy(NULL, 0, sc("§Y®É·j´M¡G")); isrch->ofst = sLen(isrch->pattern); isrch->dir = dir; isrch->quote = 0; diff -ruN joe-2.9.8/umath.c zh-joe-2.9.8/umath.c --- joe-2.9.8/umath.c Thu Mar 6 15:24:29 2003 +++ zh-joe-2.9.8/umath.c Thu Nov 3 22:57:58 2005 @@ -22,7 +22,7 @@ static RETSIGTYPE fperr(int unused) { if (!merr) { - merr = "Float point exception"; + merr = "¥²¶·¨Ï¥Î¯BÂI¼Æ"; } REINSTALL_SIGHANDLER(SIGFPE, fperr); } @@ -88,7 +88,7 @@ ++ptr; else { if (!merr) - merr = "Missing )"; + merr = "§ä¤£¨ì )"; } } else if (*ptr == '-') { ++ptr; @@ -121,7 +121,7 @@ v->set = 1; } else { if (!merr) - merr = "Left side of = is not an l-value"; + merr = "µ¥¸¹\"=\"¥ªÃ䪺­È¤£¬O¤@­Ó L-value"; } goto loop; } @@ -173,7 +173,7 @@ goto up; } } else if (*ptr) { - merr = "Extra junk after end of expr"; + merr = "¹Bºâ¦¡«á¦³ÃB¥~µL¥Îªº¹Bºâ¦¡"; } } return result; diff -ruN joe-2.9.8/undo.c zh-joe-2.9.8/undo.c --- joe-2.9.8/undo.c Thu Mar 6 15:24:29 2003 +++ zh-joe-2.9.8/undo.c Thu Nov 3 22:57:58 2005 @@ -438,7 +438,7 @@ int unotmod(BW *bw) { bw->b->changed = 0; - msgnw(bw->parent, "Modified flag cleared"); + msgnw(bw->parent, "§ó§ï¹Lªº¼Ð»x¤w¸g²M°£"); return 0; } @@ -453,7 +453,7 @@ unmark(bw); return 0; } else { - msgnw(bw->parent, "No block"); + msgnw(bw->parent, "¨S¦³¼Ð¥Ü°Ï¶ô"); return -1; } } diff -ruN joe-2.9.8/usearch.c zh-joe-2.9.8/usearch.c --- joe-2.9.8/usearch.c Thu Mar 6 15:24:29 2003 +++ zh-joe-2.9.8/usearch.c Thu Nov 3 22:57:58 2005 @@ -324,7 +324,7 @@ } vsrm(s); if (srch->replace) { - if (wmkpw(bw->parent, "Replace with (^C to abort): ", &replhist, set_replace, srchstr, pfabort, utypebw, srch, notify)) + if (wmkpw(bw->parent, "­n¥H¤°»ò¨ú¥N (^C ¤¤Â_): ", &replhist, set_replace, srchstr, pfabort, utypebw, srch, notify)) return 0; else return -1; @@ -338,7 +338,7 @@ vsrm(srch->pattern); srch->pattern = s; - if ((pbw = wmkpw(bw->parent, "(I)gnore (R)eplace (B)ackwards Bloc(K) NNN (^C to abort): ", NULL, set_options, srchstr, pfabort, utypebw, srch, notify)) != NULL) { + if ((pbw = wmkpw(bw->parent, "(I)©¿²¤ (R)¨ú¥N (B)©¹«e·j´M (K)·j´M°Ï¶ô (N)²Å¦X¦r¦ê(^C ¤¤Â_): ", NULL, set_options, srchstr, pfabort, utypebw, srch, notify)) != NULL) { char buf[10]; if (srch->ignore) @@ -383,7 +383,7 @@ } srch = setmark(mksrch(NULL, NULL, 0, back, -1, repl, 0)); srch->addr = bw->cursor->byte; - if (wmkpw(bw->parent, "Find (^C to abort): ", &findhist, set_pattern, srchstr, pfabort, utypebw, srch, NULL)) + if (wmkpw(bw->parent, "§ä´M¦r¦ê (^C ¤¤Â_): ", &findhist, set_pattern, srchstr, pfabort, utypebw, srch, NULL)) return 0; else { rmsrch(srch); @@ -413,7 +413,7 @@ P *q; if (bw->b->rdonly) { - msgnw(bw->parent, "Read only"); + msgnw(bw->parent, "°ßŪ"); return -1; } if (markk) @@ -489,7 +489,7 @@ nungetc(c); return 0; } - if (mkqwnsr(bw->parent, sc("Replace (Y)es (N)o (R)est (B)ackup (^C to abort)?"), dopfrepl, pfsave, srch, notify)) + if (mkqwnsr(bw->parent, sc("¨ú¥N (Y)¬O (N)§_ (R)¥þ³¡¨ú¥N (B)³Æ¥÷ (^C ¤¤Â_)?"), dopfrepl, pfsave, srch, notify)) return 0; else return pfsave(bw, srch); @@ -604,9 +604,9 @@ case 1: bye: if (!srch->flg && !srch->rest) { if (srch->valid && srch->block_restrict) - msgnw(bw->parent, "Not found (search restricted to marked block)"); + msgnw(bw->parent, "§ä¤£¨ì :( (·j´M½d³ò­­©w¦b©Ò¿ï©wªº°Ï¶ô¤º)"); else - msgnw(bw->parent, "Not found"); + msgnw(bw->parent, "§ä¤£¨ì :("); ret = -1; } break; diff -ruN joe-2.9.8/ushell.c zh-joe-2.9.8/ushell.c --- joe-2.9.8/ushell.c Thu Mar 6 15:24:29 2003 +++ zh-joe-2.9.8/ushell.c Thu Nov 3 22:57:59 2005 @@ -39,13 +39,13 @@ close(bw->out); bw->out = -1; if (piseof(bw->cursor)) { - binss(bw->cursor, "** Program finished **\n"); + binss(bw->cursor, "** µ{¦¡°õ¦æ§¹²¦ **\n"); p_goto_eof(bw->cursor); bw->cursor->xcol = piscol(bw->cursor); } else { P *q = pdup(bw->b->eof); - binss(q, "** Program finished **\n"); + binss(q, "** µ{¦¡°õ¦æ§¹²¦ **\n"); prm(q); } } @@ -99,7 +99,7 @@ *notify = 1; } varm(s); - msgnw(bw->parent, "Sorry, no sub-processes in DOS (yet)"); + msgnw(bw->parent, "¹ï¤£°_!¦b MS-DOS ¤U¤£¯à¥t¥~¦A°õ¦æ¤l¦æµ{!"); return -1; #else MPX *m; @@ -108,7 +108,7 @@ *notify = 1; } if (bw->pid && orphan) { - msgnw(bw->parent, "Program already running in this window"); + msgnw(bw->parent, "µ{¦¡¤w¸g¦b³o­Óµøµ¡¤¤°õ¦æ"); varm(s); return -1; } @@ -119,7 +119,7 @@ bw = (BW *) maint->curwin->object; if (!(m = mpxmk(&bw->out, name, s, cdata, bw, cdone, bw))) { varm(s); - msgnw(bw->parent, "No ptys available"); + msgnw(bw->parent, "¨S¦³¦h¾lªº ptys ¥i¨Ñ¨Ï¥Î"); return -1; } else { bw->pid = m->pid; @@ -159,7 +159,7 @@ int urun(BW *bw) { - if (wmkpw(bw->parent, "Program to run: ", &runhist, dorun, "Run", NULL, NULL, NULL, NULL)) { + if (wmkpw(bw->parent, "±ý°õ¦æªºµ{¦¡¦WºÙ: ", &runhist, dorun, "Run", NULL, NULL, NULL, NULL)) { return 0; } else { return -1; @@ -187,7 +187,7 @@ int ukillpid(BW *bw) { if (bw->pid) { - if (mkqw(bw->parent, sc("Kill program (y,n,^C)?"), pidabort, NULL, NULL, NULL)) { + if (mkqw(bw->parent, sc("¤¤Â_¥¿¦b°õ¦æªºµ{¦¡ (y,n,^C)?"), pidabort, NULL, NULL, NULL)) { return 0; } else { return -1; diff -ruN joe-2.9.8/utag.c zh-joe-2.9.8/utag.c --- joe-2.9.8/utag.c Thu Mar 6 15:24:29 2003 +++ zh-joe-2.9.8/utag.c Thu Nov 3 22:57:58 2005 @@ -37,7 +37,7 @@ } f = fopen("tags", "r"); if (!f) { - msgnw(bw->parent, "Couldn't open tags file"); + msgnw(bw->parent, "µLªk¶}±Ò¼ÐÅÒÀÉ"); vsrm(s); vsrm(t); return -1; @@ -83,7 +83,7 @@ dofollows(); mid = omid; } else { - msgnw(bw->parent, "Invalid line number"); + msgnw(bw->parent, "¤£¥¿½Tªº¦æ¼Æ"); } } else { if (buf[y] == '/' || buf[y] == '?') { @@ -116,7 +116,7 @@ } } } - msgnw(bw->parent, "Not found"); + msgnw(bw->parent, "§ä¤£¨ì"); vsrm(s); vsrm(t); fclose(f); @@ -129,7 +129,7 @@ { BW *pbw; - pbw = wmkpw(bw->parent, "Tag search: ", &taghist, dotag, NULL, NULL, cmplt, NULL, NULL); + pbw = wmkpw(bw->parent, "¼ÐÅÒ·j´M: ", &taghist, dotag, NULL, NULL, cmplt, NULL, NULL); if (pbw && isalnum_(brc(bw->cursor))) { P *p = pdup(bw->cursor); P *q = pdup(p); diff -ruN joe-2.9.8/vfile.c zh-joe-2.9.8/vfile.c --- joe-2.9.8/vfile.c Thu Mar 6 15:24:29 2003 +++ zh-joe-2.9.8/vfile.c Thu Nov 3 22:57:59 2005 @@ -191,7 +191,7 @@ pp->next = vp->next; goto gotit; } - write(2, "vfile: out of memory\n", 21); + write(2, "vfile: °O¾ÐÅ餣¨¬\n", 21); exit(1); gotit: @@ -246,7 +246,7 @@ new->name = vsncpy(NULL, 0, sz(name)); new->fd = open(name, O_RDWR); if (!new->fd) { - fprintf(stderr, "Couldn\'t open file \'%s\'\n", name); + fprintf(stderr, "µLªk¶}±ÒÀÉ®× \'%s\'\n", name); joe_free(new); return NULL; }