Loweynet
リビジョン | c77292a7a46ba795cbc2a728f1ecdfbbc39811bc (tree) |
---|---|
日時 | 2011-09-15 09:31:52 |
作者 | s_kawamoto <s_kawamoto@user...> |
コミッター | s_kawamoto |
Fix small bugs (they usually do not occur).
@@ -413,7 +413,9 @@ static int InitApp(LPSTR lpszCmdLine, int cmdShow) | ||
413 | 413 | DispTransferType(); |
414 | 414 | SetHostKanaCnvImm(YES); |
415 | 415 | SetHostKanjiCodeImm(KANJI_NOCNV); |
416 | - SetLocalKanjiCodeImm(KANJI_UTF8N); | |
416 | + // {Í[JÌftHgðUTF-8ɵ½¢ªo[WÆÌÝ·«Ì½ßShift_JISÉÝè | |
417 | +// SetLocalKanjiCodeImm(KANJI_UTF8N); | |
418 | + SetLocalKanjiCodeImm(KANJI_SJIS); | |
417 | 419 | DispListType(); |
418 | 420 | DispDotFileMode(); |
419 | 421 | DispSyncMoveMode(); |
@@ -82,6 +82,22 @@ int TerminateStringW(LPWSTR lpString, int size) | ||
82 | 82 | return i; |
83 | 83 | } |
84 | 84 | |
85 | +// Shift_JIS¶ñobt@I[ð§IÉNULLÅu· | |
86 | +int TerminateStringA(LPSTR lpString, int size) | |
87 | +{ | |
88 | + int i; | |
89 | + if(lpString < (LPSTR)0x00010000 || lpString == (LPSTR)~0) | |
90 | + return 0; | |
91 | + for(i = 0; i < size; i++) | |
92 | + { | |
93 | + if(lpString[i] == '\0') | |
94 | + return i; | |
95 | + } | |
96 | + i--; | |
97 | + lpString[i] = '\0'; | |
98 | + return i; | |
99 | +} | |
100 | + | |
85 | 101 | // NULLæØè¡}`oCg¶ñÌ·³ðæ¾ |
86 | 102 | size_t GetMultiStringLengthM(LPCSTR lpString) |
87 | 103 | { |
@@ -112,6 +128,21 @@ size_t GetMultiStringLengthW(LPCWSTR lpString) | ||
112 | 128 | return i; |
113 | 129 | } |
114 | 130 | |
131 | +// NULLæØè¡Shift_JIS¶ñÌ·³ðæ¾ | |
132 | +size_t GetMultiStringLengthA(LPCSTR lpString) | |
133 | +{ | |
134 | + size_t i; | |
135 | + if(lpString < (LPCSTR)0x00010000 || lpString == (LPCSTR)~0) | |
136 | + return 0; | |
137 | + i = 0; | |
138 | + while(lpString[i] != '\0' || lpString[i + 1] != '\0') | |
139 | + { | |
140 | + i++; | |
141 | + } | |
142 | + i++; | |
143 | + return i; | |
144 | +} | |
145 | + | |
115 | 146 | // NULLæØè}`oCg¶ñ©çCh¶ñÖÏ· |
116 | 147 | int MtoWMultiString(LPWSTR pDst, int size, LPCSTR pSrc) |
117 | 148 | { |
@@ -148,7 +179,7 @@ int WtoMMultiString(LPSTR pDst, int size, LPCWSTR pSrc) | ||
148 | 179 | return i; |
149 | 180 | } |
150 | 181 | |
151 | -// NULLæØèCh¶ñ©ç}`oCg¶ñÖÏ· | |
182 | +// NULLæØèCh¶ñ©çShift_JIS¶ñÖÏ· | |
152 | 183 | int WtoAMultiString(LPSTR pDst, int size, LPCWSTR pSrc) |
153 | 184 | { |
154 | 185 | int i; |
@@ -136,8 +136,13 @@ int WtoM(LPSTR pDst, int size, LPCWSTR pSrc, int count); | ||
136 | 136 | int WtoA(LPSTR pDst, int size, LPCWSTR pSrc, int count); |
137 | 137 | int TerminateStringM(LPSTR lpString, int size); |
138 | 138 | int TerminateStringW(LPWSTR lpString, int size); |
139 | +int TerminateStringA(LPWSTR lpString, int size); | |
139 | 140 | size_t GetMultiStringLengthM(LPCSTR lpString); |
140 | 141 | size_t GetMultiStringLengthW(LPCWSTR lpString); |
142 | +size_t GetMultiStringLengthA(LPCWSTR lpString); | |
143 | +int MtoWMultiString(LPWSTR pDst, int size, LPCSTR pSrc); | |
144 | +int WtoMMultiString(LPSTR pDst, int size, LPCWSTR pSrc); | |
145 | +int WtoAMultiString(LPSTR pDst, int size, LPCWSTR pSrc); | |
141 | 146 | char* AllocateStringM(int size); |
142 | 147 | wchar_t* AllocateStringW(int size); |
143 | 148 | char* AllocateStringA(int size); |
@@ -1340,8 +1340,8 @@ int ChangeFnameRemote2Local(char *Fname, int Max) | ||
1340 | 1340 | // TODO |
1341 | 1341 | InitCodeConvInfo(&cInfo); |
1342 | 1342 | cInfo.KanaCnv = NO; |
1343 | - cInfo.Str = Pos; | |
1344 | - cInfo.StrLen = strlen(Pos); | |
1343 | + cInfo.Str = Fname; | |
1344 | + cInfo.StrLen = strlen(Fname); | |
1345 | 1345 | cInfo.Buf = Buf; |
1346 | 1346 | cInfo.BufSize = Max - 1; |
1347 | 1347 | ConvSJIStoUTF8N(&cInfo); |
@@ -1364,8 +1364,8 @@ int ChangeFnameRemote2Local(char *Fname, int Max) | ||
1364 | 1364 | // TODO |
1365 | 1365 | InitCodeConvInfo(&cInfo); |
1366 | 1366 | cInfo.KanaCnv = NO; |
1367 | - cInfo.Str = Pos; | |
1368 | - cInfo.StrLen = strlen(Pos); | |
1367 | + cInfo.Str = Fname; | |
1368 | + cInfo.StrLen = strlen(Fname); | |
1369 | 1369 | cInfo.Buf = Buf; |
1370 | 1370 | cInfo.BufSize = Max - 1; |
1371 | 1371 | ConvSJIStoUTF8N(&cInfo); |
@@ -1389,8 +1389,8 @@ int ChangeFnameRemote2Local(char *Fname, int Max) | ||
1389 | 1389 | // TODO |
1390 | 1390 | InitCodeConvInfo(&cInfo); |
1391 | 1391 | cInfo.KanaCnv = NO; |
1392 | - cInfo.Str = Pos; | |
1393 | - cInfo.StrLen = strlen(Pos); | |
1392 | + cInfo.Str = Fname; | |
1393 | + cInfo.StrLen = strlen(Fname); | |
1394 | 1394 | cInfo.Buf = Buf; |
1395 | 1395 | cInfo.BufSize = Max - 1; |
1396 | 1396 | ConvSJIStoUTF8N(&cInfo); |
@@ -1472,8 +1472,8 @@ int ChangeFnameLocal2Remote(char *Fname, int Max) | ||
1472 | 1472 | // TODO |
1473 | 1473 | InitCodeConvInfo(&cInfo); |
1474 | 1474 | cInfo.KanaCnv = NO; |
1475 | - cInfo.Str = Pos; | |
1476 | - cInfo.StrLen = strlen(Pos); | |
1475 | + cInfo.Str = Fname; | |
1476 | + cInfo.StrLen = strlen(Fname); | |
1477 | 1477 | cInfo.Buf = Buf; |
1478 | 1478 | cInfo.BufSize = Max - 1; |
1479 | 1479 | ConvSJIStoJIS(&cInfo); |
@@ -1496,8 +1496,8 @@ int ChangeFnameLocal2Remote(char *Fname, int Max) | ||
1496 | 1496 | // TODO |
1497 | 1497 | InitCodeConvInfo(&cInfo); |
1498 | 1498 | cInfo.KanaCnv = NO; |
1499 | - cInfo.Str = Pos; | |
1500 | - cInfo.StrLen = strlen(Pos); | |
1499 | + cInfo.Str = Fname; | |
1500 | + cInfo.StrLen = strlen(Fname); | |
1501 | 1501 | cInfo.Buf = Buf; |
1502 | 1502 | cInfo.BufSize = Max - 1; |
1503 | 1503 | ConvSJIStoEUC(&cInfo); |
@@ -1520,8 +1520,8 @@ int ChangeFnameLocal2Remote(char *Fname, int Max) | ||
1520 | 1520 | // TODO |
1521 | 1521 | InitCodeConvInfo(&cInfo); |
1522 | 1522 | cInfo.KanaCnv = NO; |
1523 | - cInfo.Str = Pos; | |
1524 | - cInfo.StrLen = strlen(Pos); | |
1523 | + cInfo.Str = Fname; | |
1524 | + cInfo.StrLen = strlen(Fname); | |
1525 | 1525 | cInfo.Buf = Buf; |
1526 | 1526 | cInfo.BufSize = Max - 1; |
1527 | 1527 | ConvSJIStoSMB_HEX(&cInfo); |
@@ -1544,8 +1544,8 @@ int ChangeFnameLocal2Remote(char *Fname, int Max) | ||
1544 | 1544 | // TODO |
1545 | 1545 | InitCodeConvInfo(&cInfo); |
1546 | 1546 | cInfo.KanaCnv = NO; |
1547 | - cInfo.Str = Pos; | |
1548 | - cInfo.StrLen = strlen(Pos); | |
1547 | + cInfo.Str = Fname; | |
1548 | + cInfo.StrLen = strlen(Fname); | |
1549 | 1549 | cInfo.Buf = Buf; |
1550 | 1550 | cInfo.BufSize = Max - 1; |
1551 | 1551 | ConvSJIStoSMB_CAP(&cInfo); |
@@ -200,7 +200,11 @@ BOOL AttachSSL(SOCKET s) | ||
200 | 200 | } |
201 | 201 | } |
202 | 202 | else |
203 | + { | |
204 | + LeaveCriticalSection(&g_OpenSSLLock); | |
203 | 205 | DetachSSL(s); |
206 | + EnterCriticalSection(&g_OpenSSLLock); | |
207 | + } | |
204 | 208 | } |
205 | 209 | } |
206 | 210 | } |