svnno****@sourc*****
svnno****@sourc*****
2010年 3月 26日 (金) 18:09:02 JST
Revision: 3826 http://sourceforge.jp/projects/ttssh2/svn/view?view=rev&revision=3826 Author: yutakapon Date: 2010-03-26 18:09:02 +0900 (Fri, 26 Mar 2010) Log Message: ----------- XMODEM: åä¿¡ãããã¤ããªãã¡ã¤ã«ã®æ«å°¾ã«ãCPMEOF(0x1A)ãé¤å»ãããªãã¾ã¾ã¨ãªã£ã¦ããåé¡ãä¿®æ£ããã Modified Paths: -------------- trunk/doc/en/html/about/history.html trunk/doc/ja/html/about/history.html trunk/teraterm/ttpfile/xmodem.c -------------- next part -------------- Modified: trunk/doc/en/html/about/history.html =================================================================== --- trunk/doc/en/html/about/history.html 2010-03-26 06:47:13 UTC (rev 3825) +++ trunk/doc/en/html/about/history.html 2010-03-26 09:09:02 UTC (rev 3826) @@ -30,7 +30,7 @@ <h2><a name="teraterm">Tera Term</a></h2> -<h3><a name="teraterm_4.66">2010.3.24 (Ver 4.66 unreleased)</a></h3> +<h3><a name="teraterm_4.66">2010.3.26 (Ver 4.66 unreleased)</a></h3> <ul class="history"> <li>Changes <ul> @@ -51,6 +51,7 @@ <!--li>ãÖXN[obt@ÎÌJ[\ÊuÛ¶§äV[PXÅAãÖæÊobt@ÖÌØèÖ¦A¨æÑæÊÌNAªsíêÄ¢½ÌðC³µ½B</li--> <li>If ClearOnResize setting is on, DECCOLM (Change Column Mode) control sequence does not clear screen.</li> <!--li>L[{[hÝèt@CÅ Alt+L[ É@\ðèĽA]vȶñªÇÁÅoͳêéÌðC³µ½B</li--> + <li>XMODEM: A received file may include the CPMEOF(0x1A) block at the end of the file.</li> </ul> </li> Modified: trunk/doc/ja/html/about/history.html =================================================================== --- trunk/doc/ja/html/about/history.html 2010-03-26 06:47:13 UTC (rev 3825) +++ trunk/doc/ja/html/about/history.html 2010-03-26 09:09:02 UTC (rev 3826) @@ -30,7 +30,7 @@ <h2><a name="teraterm">Tera Term</a></h2> -<h3><a name="teraterm_4.66">2010.3.24 (Ver 4.66 unreleased)</a></h3> +<h3><a name="teraterm_4.66">2010.3.26 (Ver 4.66 unreleased)</a></h3> <ul class="history"> <li>ÏX <ul> @@ -50,6 +50,7 @@ <li>ãÖXN[obt@ÎÌJ[\ÊuÛ¶§äV[PXÅAãÖæÊobt@ÖÌØèÖ¦A¨æÑæÊÌNAªsíêÄ¢½ÌðC³µ½B</li> <li>ClearOnResize ª on ÌADECCOLM( [hÏX)§äV[PXÅæʪNA³êÈ¢ÌðC³µ½B</li> <li>L[{[hÝèt@CÅ Alt+L[ É@\ðèĽA]vȶñªÇÁÅoͳêéÌðC³µ½B</li> + <li>XMODEM: óMµ½oCit@CÌöÉACPMEOF(0x1A)ª³êÈ¢ÜÜÆÈÁÄ¢½âèðC³µ½B</li> </ul> </li> Modified: trunk/teraterm/ttpfile/xmodem.c =================================================================== --- trunk/teraterm/ttpfile/xmodem.c 2010-03-26 06:47:13 UTC (rev 3825) +++ trunk/teraterm/ttpfile/xmodem.c 2010-03-26 09:09:02 UTC (rev 3826) @@ -7,6 +7,10 @@ #include "tttypes.h" #include "ttftypes.h" #include <stdio.h> +#include <io.h> +#include <sys/stat.h> +#include <sys/types.h> +#include <fcntl.h> #include "tt_res.h" #include "ttcommon.h" @@ -220,6 +224,12 @@ FTSetTimeOut(fv, TimeOutVeryLong); break; case IdXReceive: +#if 0 +// strcpy(inistr, "sx svnrev.exe\r\n"); + strcpy(inistr, "sx -b lrzsz-0.12.20.tar.gz\r\n"); + XWrite(fv, xv, cv, inistr, strlen(inistr)); +#endif + XSendNAK(fv, xv, cv); break; } @@ -249,7 +259,7 @@ BOOL XReadPacket(PFileVar fv, PXVar xv, PComVar cv) { BYTE b, d; - int i, c; + int i, c, t; BOOL GetPkt; c = XRead1Byte(fv, xv, cv, &b); @@ -271,6 +281,21 @@ XSetOpt(fv, xv, Xopt1K); FTSetTimeOut(fv, xv->TOutShort); } else if (b == EOT) { + // oCi[hÌêAöÌCPMEOFðí·éB + if (xv->TextFlag == 0) { + int fd; + + _lclose(fv->FileHandle); + fv->FileHandle = -1; + fv->FileOpen = 0; + + fd = _open(fv->FullName, _O_RDWR); + if (fd != -1) { + _chsize_s(fd, fv->FileSize); + _close(fd); + } + } + b = ACK; fv->Success = TRUE; XWrite(fv, xv, cv, &b, 1); @@ -351,10 +376,20 @@ if (xv->PktNum == 0) xv->PktNumOffset = xv->PktNumOffset + 256; - c = xv->DataLen; + // XMODEMÌdlÉæêÎAÅãÌubNª 128/1024 byteɽȢêACPMEOF(0x1A)Å + // pfBO·é±ÆÉÈÁÄ¢éBASCII[hEoCi[hÍÖWÈA³ðÉ + // pfBO³êéB"lrzsz-0.12.20"Ì filbuf()#src/lsz.c ÌÀ໤ÈÁÄ¢éB + // æÁÄA³ðÉ CPMEOF íª®ì·éæ¤ÉµAoCit@CÌöªóêé + // »Ûðñð·éB + // (2010.3.26 yutaka) + t = xv->DataLen; + while ((t > 0) && (xv->PktIn[2 + t] == 0x1A)) + t--; if (xv->TextFlag > 0) - while ((c > 0) && (xv->PktIn[2 + c] == 0x1A)) - c--; + c = t; + else + c = xv->DataLen; + fv->FileSize = fv->ByteCount + t; if (xv->TextFlag > 0) for (i = 0; i <= c - 1; i++) {