Normandy Merge ....

git-svn-id: svn://10.0.0.236/trunk@4231 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
spider
1998-06-22 21:19:46 +00:00
parent a43d7627c5
commit 957093e8c5
359 changed files with 53994 additions and 13241 deletions

View File

@@ -205,6 +205,28 @@ ExternalFileSave(int iFormatOut, URL_Struct *pUrl, MWContext *pContext)
// Make a copy of the name, because that's what fe_URLtoLocalName() does
// and the code below is going to XP_FREE pSuggested
pSuggested = XP_STRDUP(pUrl->content_name);
if (pSuggested && *pSuggested) {
// check if the file doesn't have an extension
char *ext = FE_FindFileExt(pSuggested);
if (!ext) {
if (pUrl->content_type && *pUrl->content_type) {
// Look up an extension
char aExt[_MAX_EXT];
DWORD dwFlags = 0;
size_t stExt = 0;
aExt[0] = '\0';
#ifdef XP_WIN16
dwFlags |= EXT_DOT_THREE;
#endif
stExt = EXT_Invent(aExt, sizeof(aExt), dwFlags, pSuggested, pUrl->content_type);
if (stExt)
StrAllocCat (pSuggested, aExt);
}
}
}
}
if (!pSuggested)
pSuggested = fe_URLtoLocalName(pUrl->address, pUrl->content_type);