OSDN Git Service

Fix small bugs (they usually do not occur).
authors_kawamoto <s_kawamoto@users.sourceforge.jp>
Thu, 15 Sep 2011 00:31:52 +0000 (09:31 +0900)
committers_kawamoto <s_kawamoto@users.sourceforge.jp>
Thu, 15 Sep 2011 00:31:52 +0000 (09:31 +0900)
FFFTP_Eng_Release/FFFTP.exe
Package/FFFTP.exe
Release/FFFTP.exe
main.c
mbswrapper.c
mbswrapper.h
remote.c
socketwrapper.c

index 17f0f7e..54d0242 100644 (file)
Binary files a/FFFTP_Eng_Release/FFFTP.exe and b/FFFTP_Eng_Release/FFFTP.exe differ
index 2207aa0..aebffdd 100644 (file)
Binary files a/Package/FFFTP.exe and b/Package/FFFTP.exe differ
index 2207aa0..aebffdd 100644 (file)
Binary files a/Release/FFFTP.exe and b/Release/FFFTP.exe differ
diff --git a/main.c b/main.c
index 538602a..3794252 100644 (file)
--- a/main.c
+++ b/main.c
@@ -413,7 +413,9 @@ static int InitApp(LPSTR lpszCmdLine, int cmdShow)
                                DispTransferType();\r
                                SetHostKanaCnvImm(YES);\r
                                SetHostKanjiCodeImm(KANJI_NOCNV);\r
                                DispTransferType();\r
                                SetHostKanaCnvImm(YES);\r
                                SetHostKanjiCodeImm(KANJI_NOCNV);\r
-                               SetLocalKanjiCodeImm(KANJI_UTF8N);\r
+                               // \96{\93\96\82Í\83\8d\81[\83J\83\8b\82Ì\83f\83t\83H\83\8b\83g\82ðUTF-8\82É\82µ\82½\82¢\82ª\8b\8c\83o\81[\83W\83\87\83\93\82Æ\82Ì\8cÝ\8a·\90«\82Ì\82½\82ßShift_JIS\82É\90Ý\92è\r
+//                             SetLocalKanjiCodeImm(KANJI_UTF8N);\r
+                               SetLocalKanjiCodeImm(KANJI_SJIS);\r
                                DispListType();\r
                                DispDotFileMode();\r
                                DispSyncMoveMode();\r
                                DispListType();\r
                                DispDotFileMode();\r
                                DispSyncMoveMode();\r
index 337d9ff..e332123 100644 (file)
@@ -82,6 +82,22 @@ int TerminateStringW(LPWSTR lpString, int size)
        return i;
 }
 
        return i;
 }
 
+// Shift_JIS\95\8e\9a\97ñ\83o\83b\83t\83@\8fI\92[\82ð\8b­\90§\93I\82ÉNULL\82Å\92u\8a·
+int TerminateStringA(LPSTR lpString, int size)
+{
+       int i;
+       if(lpString < (LPSTR)0x00010000 || lpString == (LPSTR)~0)
+               return 0;
+       for(i = 0; i < size; i++)
+       {
+               if(lpString[i] == '\0')
+                       return i;
+       }
+       i--;
+       lpString[i] = '\0';
+       return i;
+}
+
 // NULL\8bæ\90Ø\82è\95¡\90\94\83}\83\8b\83`\83o\83C\83g\95\8e\9a\97ñ\82Ì\92·\82³\82ð\8eæ\93¾
 size_t GetMultiStringLengthM(LPCSTR lpString)
 {
 // NULL\8bæ\90Ø\82è\95¡\90\94\83}\83\8b\83`\83o\83C\83g\95\8e\9a\97ñ\82Ì\92·\82³\82ð\8eæ\93¾
 size_t GetMultiStringLengthM(LPCSTR lpString)
 {
@@ -112,6 +128,21 @@ size_t GetMultiStringLengthW(LPCWSTR lpString)
        return i;
 }
 
        return i;
 }
 
+// NULL\8bæ\90Ø\82è\95¡\90\94Shift_JIS\95\8e\9a\97ñ\82Ì\92·\82³\82ð\8eæ\93¾
+size_t GetMultiStringLengthA(LPCSTR lpString)
+{
+       size_t i;
+       if(lpString < (LPCSTR)0x00010000 || lpString == (LPCSTR)~0)
+               return 0;
+       i = 0;
+       while(lpString[i] != '\0' || lpString[i + 1] != '\0')
+       {
+               i++;
+       }
+       i++;
+       return i;
+}
+
 // NULL\8bæ\90Ø\82è\83}\83\8b\83`\83o\83C\83g\95\8e\9a\97ñ\82©\82ç\83\8f\83C\83h\95\8e\9a\97ñ\82Ö\95Ï\8a·
 int MtoWMultiString(LPWSTR pDst, int size, LPCSTR pSrc)
 {
 // NULL\8bæ\90Ø\82è\83}\83\8b\83`\83o\83C\83g\95\8e\9a\97ñ\82©\82ç\83\8f\83C\83h\95\8e\9a\97ñ\82Ö\95Ï\8a·
 int MtoWMultiString(LPWSTR pDst, int size, LPCSTR pSrc)
 {
@@ -148,7 +179,7 @@ int WtoMMultiString(LPSTR pDst, int size, LPCWSTR pSrc)
        return i;
 }
 
        return i;
 }
 
-// NULL\8bæ\90Ø\82è\83\8f\83C\83h\95\8e\9a\97ñ\82©\82ç\83}\83\8b\83`\83o\83C\83g\95\8e\9a\97ñ\82Ö\95Ï\8a·
+// NULL\8bæ\90Ø\82è\83\8f\83C\83h\95\8e\9a\97ñ\82©\82çShift_JIS\95\8e\9a\97ñ\82Ö\95Ï\8a·
 int WtoAMultiString(LPSTR pDst, int size, LPCWSTR pSrc)
 {
        int i;
 int WtoAMultiString(LPSTR pDst, int size, LPCWSTR pSrc)
 {
        int i;
index 15221a5..aaf6e1b 100644 (file)
@@ -136,8 +136,13 @@ int WtoM(LPSTR pDst, int size, LPCWSTR pSrc, int count);
 int WtoA(LPSTR pDst, int size, LPCWSTR pSrc, int count);
 int TerminateStringM(LPSTR lpString, int size);
 int TerminateStringW(LPWSTR lpString, int size);
 int WtoA(LPSTR pDst, int size, LPCWSTR pSrc, int count);
 int TerminateStringM(LPSTR lpString, int size);
 int TerminateStringW(LPWSTR lpString, int size);
+int TerminateStringA(LPWSTR lpString, int size);
 size_t GetMultiStringLengthM(LPCSTR lpString);
 size_t GetMultiStringLengthW(LPCWSTR lpString);
 size_t GetMultiStringLengthM(LPCSTR lpString);
 size_t GetMultiStringLengthW(LPCWSTR lpString);
+size_t GetMultiStringLengthA(LPCWSTR lpString);
+int MtoWMultiString(LPWSTR pDst, int size, LPCSTR pSrc);
+int WtoMMultiString(LPSTR pDst, int size, LPCWSTR pSrc);
+int WtoAMultiString(LPSTR pDst, int size, LPCWSTR pSrc);
 char* AllocateStringM(int size);
 wchar_t* AllocateStringW(int size);
 char* AllocateStringA(int size);
 char* AllocateStringM(int size);
 wchar_t* AllocateStringW(int size);
 char* AllocateStringA(int size);
index 2244517..6097727 100644 (file)
--- a/remote.c
+++ b/remote.c
@@ -1340,8 +1340,8 @@ int ChangeFnameRemote2Local(char *Fname, int Max)
                                // TODO\r
                                InitCodeConvInfo(&cInfo);\r
                                cInfo.KanaCnv = NO;\r
                                // TODO\r
                                InitCodeConvInfo(&cInfo);\r
                                cInfo.KanaCnv = NO;\r
-                               cInfo.Str = Pos;\r
-                               cInfo.StrLen = strlen(Pos);\r
+                               cInfo.Str = Fname;\r
+                               cInfo.StrLen = strlen(Fname);\r
                                cInfo.Buf = Buf;\r
                                cInfo.BufSize = Max - 1;\r
                                ConvSJIStoUTF8N(&cInfo);\r
                                cInfo.Buf = Buf;\r
                                cInfo.BufSize = Max - 1;\r
                                ConvSJIStoUTF8N(&cInfo);\r
@@ -1364,8 +1364,8 @@ int ChangeFnameRemote2Local(char *Fname, int Max)
                                // TODO\r
                                InitCodeConvInfo(&cInfo);\r
                                cInfo.KanaCnv = NO;\r
                                // TODO\r
                                InitCodeConvInfo(&cInfo);\r
                                cInfo.KanaCnv = NO;\r
-                               cInfo.Str = Pos;\r
-                               cInfo.StrLen = strlen(Pos);\r
+                               cInfo.Str = Fname;\r
+                               cInfo.StrLen = strlen(Fname);\r
                                cInfo.Buf = Buf;\r
                                cInfo.BufSize = Max - 1;\r
                                ConvSJIStoUTF8N(&cInfo);\r
                                cInfo.Buf = Buf;\r
                                cInfo.BufSize = Max - 1;\r
                                ConvSJIStoUTF8N(&cInfo);\r
@@ -1389,8 +1389,8 @@ int ChangeFnameRemote2Local(char *Fname, int Max)
                                // TODO\r
                                InitCodeConvInfo(&cInfo);\r
                                cInfo.KanaCnv = NO;\r
                                // TODO\r
                                InitCodeConvInfo(&cInfo);\r
                                cInfo.KanaCnv = NO;\r
-                               cInfo.Str = Pos;\r
-                               cInfo.StrLen = strlen(Pos);\r
+                               cInfo.Str = Fname;\r
+                               cInfo.StrLen = strlen(Fname);\r
                                cInfo.Buf = Buf;\r
                                cInfo.BufSize = Max - 1;\r
                                ConvSJIStoUTF8N(&cInfo);\r
                                cInfo.Buf = Buf;\r
                                cInfo.BufSize = Max - 1;\r
                                ConvSJIStoUTF8N(&cInfo);\r
@@ -1472,8 +1472,8 @@ int ChangeFnameLocal2Remote(char *Fname, int Max)
                                // TODO\r
                                InitCodeConvInfo(&cInfo);\r
                                cInfo.KanaCnv = NO;\r
                                // TODO\r
                                InitCodeConvInfo(&cInfo);\r
                                cInfo.KanaCnv = NO;\r
-                               cInfo.Str = Pos;\r
-                               cInfo.StrLen = strlen(Pos);\r
+                               cInfo.Str = Fname;\r
+                               cInfo.StrLen = strlen(Fname);\r
                                cInfo.Buf = Buf;\r
                                cInfo.BufSize = Max - 1;\r
                                ConvSJIStoJIS(&cInfo);\r
                                cInfo.Buf = Buf;\r
                                cInfo.BufSize = Max - 1;\r
                                ConvSJIStoJIS(&cInfo);\r
@@ -1496,8 +1496,8 @@ int ChangeFnameLocal2Remote(char *Fname, int Max)
                                // TODO\r
                                InitCodeConvInfo(&cInfo);\r
                                cInfo.KanaCnv = NO;\r
                                // TODO\r
                                InitCodeConvInfo(&cInfo);\r
                                cInfo.KanaCnv = NO;\r
-                               cInfo.Str = Pos;\r
-                               cInfo.StrLen = strlen(Pos);\r
+                               cInfo.Str = Fname;\r
+                               cInfo.StrLen = strlen(Fname);\r
                                cInfo.Buf = Buf;\r
                                cInfo.BufSize = Max - 1;\r
                                ConvSJIStoEUC(&cInfo);\r
                                cInfo.Buf = Buf;\r
                                cInfo.BufSize = Max - 1;\r
                                ConvSJIStoEUC(&cInfo);\r
@@ -1520,8 +1520,8 @@ int ChangeFnameLocal2Remote(char *Fname, int Max)
                                // TODO\r
                                InitCodeConvInfo(&cInfo);\r
                                cInfo.KanaCnv = NO;\r
                                // TODO\r
                                InitCodeConvInfo(&cInfo);\r
                                cInfo.KanaCnv = NO;\r
-                               cInfo.Str = Pos;\r
-                               cInfo.StrLen = strlen(Pos);\r
+                               cInfo.Str = Fname;\r
+                               cInfo.StrLen = strlen(Fname);\r
                                cInfo.Buf = Buf;\r
                                cInfo.BufSize = Max - 1;\r
                                ConvSJIStoSMB_HEX(&cInfo);\r
                                cInfo.Buf = Buf;\r
                                cInfo.BufSize = Max - 1;\r
                                ConvSJIStoSMB_HEX(&cInfo);\r
@@ -1544,8 +1544,8 @@ int ChangeFnameLocal2Remote(char *Fname, int Max)
                                // TODO\r
                                InitCodeConvInfo(&cInfo);\r
                                cInfo.KanaCnv = NO;\r
                                // TODO\r
                                InitCodeConvInfo(&cInfo);\r
                                cInfo.KanaCnv = NO;\r
-                               cInfo.Str = Pos;\r
-                               cInfo.StrLen = strlen(Pos);\r
+                               cInfo.Str = Fname;\r
+                               cInfo.StrLen = strlen(Fname);\r
                                cInfo.Buf = Buf;\r
                                cInfo.BufSize = Max - 1;\r
                                ConvSJIStoSMB_CAP(&cInfo);\r
                                cInfo.Buf = Buf;\r
                                cInfo.BufSize = Max - 1;\r
                                ConvSJIStoSMB_CAP(&cInfo);\r
index e4f03b0..acbb8a0 100644 (file)
@@ -200,7 +200,11 @@ BOOL AttachSSL(SOCKET s)
                                        }
                                }
                                else
                                        }
                                }
                                else
+                               {
+                                       LeaveCriticalSection(&g_OpenSSLLock);
                                        DetachSSL(s);
                                        DetachSSL(s);
+                                       EnterCriticalSection(&g_OpenSSLLock);
+                               }
                        }
                }
        }
                        }
                }
        }