immortalwrt/package/lean/antileech/src/antiLeech_wx.cpp
ope087 2b98cdae2e Add antileech for amule
* add antileech for amule-dlp

aMule-dlp必备组件缺少这个插件aMule-dlp是不能正常下载东西的.

* Delete Makefile

* Delete CString_wx.h

* Delete Interface.cpp

* Delete Makefile.am

* Delete antiLeech.cpp

* Delete antiLeech.h

* Delete antiLeech_wx.cpp

* Delete antiLeech_wx.h

* Delete autogen.sh

* Delete configure.ac

* Delete sdc2amule.diff

* add antileech for amule-dlp

aMule-dlp必备组件缺少这个插件aMule-dlp是不能正常下载东西的.

* Update README
2018-11-19 17:03:34 +08:00

26 lines
665 B
C++

//Author: greensea <gs@bbxy.net>
#include "antiLeech_wx.h" //Modified by Bill Lee.
//Bug fixed by Orzogc Lee
LPCTSTR StrStrI(LPCTSTR haystack, LPCTSTR needle){
//Bill Lee: allocate wchar array on the stack
wchar_t haystacki[512];
wchar_t needlei[512];
int i = 0;
do{
haystacki[i] = towlower(haystack[i]);
if(i == 511)
break;
}while(haystack[i++]); //As haystacki is allocated on the stack, it wans't set 0. So the NULL needs to be copy.
i = 0;
do{
needlei[i] = towlower(needle[i]);
if(i == 511)
break;
}while(needle[i++]);
const wchar_t* ret = wcsstr(haystacki, needlei);
if(ret != NULL)
ret = ret - haystacki + haystack;
return ret;
}