Skip to content
This repository has been archived by the owner on Dec 16, 2019. It is now read-only.

Commit

Permalink
DeGhostModName now skips filenames < 7 characters long
Browse files Browse the repository at this point in the history
  • Loading branch information
waruddar committed Sep 29, 2011
1 parent 5a8ab18 commit c82c017
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
Binary file modified CBash.suo
Binary file not shown.
15 changes: 9 additions & 6 deletions CBash/Common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,13 +125,16 @@ STRING DeGhostModName(STRING const ModName)
{
STRING NonGhostName = NULL;
UINT32 NameLength = (UINT32)strlen(ModName) + 1;
if(icmps(".ghost",ModName + NameLength - 7) == 0)
if(NameLength > 7)
{
NonGhostName = new char[NameLength];
strcpy_s(NonGhostName, NameLength, ModName);
NonGhostName[NameLength - 7] = 0x00;
//printer("DeGhostModName: De-ghosted (%s)(%d) to (%s)(%d)\n", ModName, strlen(ModName), NonGhostName, strlen(NonGhostName));
return NonGhostName;
if(icmps(".ghost",ModName + NameLength - 7) == 0)
{
NonGhostName = new char[NameLength];
strcpy_s(NonGhostName, NameLength, ModName);
NonGhostName[NameLength - 7] = 0x00;
//printer("DeGhostModName: De-ghosted (%s)(%d) to (%s)(%d)\n", ModName, strlen(ModName), NonGhostName, strlen(NonGhostName));
return NonGhostName;
}
}
return NULL;
}
Expand Down
Binary file modified release/CBash.dll
Binary file not shown.

0 comments on commit c82c017

Please sign in to comment.