| 94 |
decodeFileName = decode(fileName->mb_str()); |
decodeFileName = decode(fileName->mb_str()); |
| 95 |
snprintf(decodeFileNameBuf, MAX_BUF_SIZE, "%s", decodeFileName); |
snprintf(decodeFileNameBuf, MAX_BUF_SIZE, "%s", decodeFileName); |
| 96 |
toLower(buf); |
toLower(buf); |
|
toLower(outbuf); |
|
| 97 |
toLower(decodeFileNameBuf); |
toLower(decodeFileNameBuf); |
| 98 |
found = TRUE; |
found = TRUE; |
| 99 |
for(i = 0; tokenList[i] != NULL; i++){ |
for(i = 0; tokenList[i] != NULL; i++){ |
| 100 |
|
toLower(tokenList[i]); |
| 101 |
if(strstr((const char*)buf, (const char*)tokenList[i]) || |
if(strstr((const char*)buf, (const char*)tokenList[i]) || |
| 102 |
strstr((const char*)decodeFileName, (const char*)tokenList[i])) { |
strstr((const char*)decodeFileName, (const char*)tokenList[i])) { |
| 103 |
found = TRUE; |
found = TRUE; |
| 287 |
sprintf(newFullPath, "%s/%s", (const char*)dataDirName->mb_str(), (const char*)fileName->mb_str()); |
sprintf(newFullPath, "%s/%s", (const char*)dataDirName->mb_str(), (const char*)fileName->mb_str()); |
| 288 |
|
|
| 289 |
if((fp = fopen(newFullPath, "r")) == NULL) { |
if((fp = fopen(newFullPath, "r")) == NULL) { |
| 290 |
rename(oldFullPath, newFullPath); |
if(rename(oldFullPath, newFullPath) < 0) wxLogMessage(wxT("rename error: errno=[%d]"), errno); |
| 291 |
} |
} |
| 292 |
else if(strcmp(oldFullPath, newFullPath)){ |
else if(strcmp(oldFullPath, newFullPath)){ |
| 293 |
wxLogMessage(wxT("File has already exist. [%s]"), fileName->c_str()); |
wxLogMessage(wxT("File has already exist. [%s]"), fileName->c_str()); |
| 294 |
fclose(fp); |
fclose(fp); |
| 295 |
} |
} |
| 296 |
|
else { |
| 297 |
|
fclose(fp); |
| 298 |
|
} |
| 299 |
|
|
| 300 |
delete oldSubject; |
delete oldSubject; |
| 301 |
delete oldFileName; |
delete oldFileName; |