21789. r=gagan, a=don. The Extension() method for url's was returning everything after the *first* dot as the extension, rather than everything after the *last* dot. Now we return everything after the *last* dot as the extension
git-svn-id: svn://10.0.0.236/trunk@56527 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -141,8 +141,10 @@ nsStdURL::GetFileExtension(char* *o_FileExtension)
|
||||
|
||||
char *dot = mFileName;
|
||||
if (dot) {
|
||||
while (*dot && (*dot != '.')) dot++; // goto the dot.
|
||||
if (*dot) {
|
||||
// find the last dot
|
||||
while (*dot) dot++;
|
||||
while ( (dot != mFileName) && (*dot != '.') ) dot--; // goto the dot.
|
||||
if (*dot == '.') {
|
||||
nsCAutoString ext(dot+1);
|
||||
*o_FileExtension = ext.ToNewCString();
|
||||
if (!*o_FileExtension) return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
||||
Reference in New Issue
Block a user