Skip to content

Commit

Permalink
Merge pull request DediProgSW#12 from andreasmueller/master
Browse files Browse the repository at this point in the history
make file ending detection slightly more stable
  • Loading branch information
Benwang217 authored Oct 20, 2020
2 parents 9d952c7 + 8664e70 commit 0317fa1
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions project.c
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,17 @@ int GetFileFormatFromExt(const char* csPath)

while(csPath[i] != '.')
{
if (i==0) {
return BIN;
}

i--;
}

if (length-i > 5) {
return BIN;
}

for(j=i;j<length; j++)
{
fmt[j-i]=toupper(csPath[j]);
Expand Down

0 comments on commit 0317fa1

Please sign in to comment.