Skip to content
This repository has been archived by the owner on Jul 1, 2020. It is now read-only.

Commit

Permalink
Improve user experience and program performance.
Browse files Browse the repository at this point in the history
  • Loading branch information
Too-Naive committed Aug 30, 2016
1 parent 3144d9b commit 85c0837
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
#define objectwebsite _T("https:\x2f\x2fgithub.com/HostsTools/Windows")
//end.

#define ConsoleTitle _T("racaljk-host tool v2.1.12 Build time:Aug. 26nd, '16")
#define ConsoleTitle _T("racaljk-host tool v2.1.12 Build time:Aug. 30th, '16")

#define CASE(x,y) case x : y; break;
#define pWait _T("\n \
Expand Down Expand Up @@ -508,12 +508,14 @@ Error code:(%ld)\n"),GetLastError());
}

//short path if str has ".."
//Should we need check "\\..\\" ?
TCHAR * dotdotcheck(TCHAR * str){
TCHAR * _; TCHAR *_tmp=new TCHAR[100];
memset(_tmp,0,sizeof(_tmp));
if ((_=_tcsstr(str,_T("..")))){
_stscanf(_+2,_T("%100s"),_tmp);
while ((*(--_))!='\\');
// while ((*(--_))!='\\');
--_;
while ((*(--_))!='\\');
_stprintf(_,_T("%s"),_tmp);
}
Expand Down Expand Up @@ -706,6 +708,7 @@ void Func_CallCopyHostsFile(SYSTEMTIME & st){
_fputts(_T(""),_);
if (!(fp=_tfopen(ChangeCTLR,_T("rb"))))
throw ChangeCTLR;
_ftprintf(_,_T("\n"));
size_t readbyte=0;
while ((readbyte=fread(iobuffer,sizeof(char),localbufsize,fp)))
fwrite(iobuffer,sizeof(char),readbyte,_);
Expand Down

0 comments on commit 85c0837

Please sign in to comment.