From 3ba0f6cca62d49d20234f71fffe840cca42ef259 Mon Sep 17 00:00:00 2001 From: "sspitzer%netscape.com" Date: Thu, 24 Apr 2003 06:40:56 +0000 Subject: [PATCH] fix for bug #159995 crash when cancelling print / print preview of news messages with attachments. also, when print / print preview of news messages, attachments don't show. r/sr=bienvenu, a=sspitzer --- mailnews/news/src/nsNNTPProtocol.cpp | 2 +- mailnews/news/src/nsNntpUrl.cpp | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/mailnews/news/src/nsNNTPProtocol.cpp b/mailnews/news/src/nsNNTPProtocol.cpp index 8dd6222f2e33..915101b7c68a 100644 --- a/mailnews/news/src/nsNNTPProtocol.cpp +++ b/mailnews/news/src/nsNNTPProtocol.cpp @@ -1398,7 +1398,7 @@ nsNNTPProtocol::ParseURL(nsIURI * aURL, char ** aGroup, char ** aMessageID, if (m_newsAction == nsINntpUrl::ActionSearch) { nsUnescape(group); } - else if (PL_strchr(group, '@') || PL_strstr(group,"%40")) { + else if (strchr(group, '@') || strstr(group,"%40")) { message_id = nsUnescape(group); group = 0; } diff --git a/mailnews/news/src/nsNntpUrl.cpp b/mailnews/news/src/nsNntpUrl.cpp index e22026aed4ef..9c69c3df7091 100644 --- a/mailnews/news/src/nsNntpUrl.cpp +++ b/mailnews/news/src/nsNntpUrl.cpp @@ -107,10 +107,8 @@ NS_IMETHODIMP nsNntpUrl::SetSpec(const nsACString &aSpec) nsresult nsNntpUrl::DetermineNewsAction() { - nsresult rv; - nsCAutoString path; - rv = nsMsgMailNewsUrl::GetPath(path); + nsresult rv = nsMsgMailNewsUrl::GetPath(path); NS_ENSURE_SUCCESS(rv,rv); if (!strcmp(path.get(),"/*")) { @@ -137,8 +135,9 @@ nsresult nsNntpUrl::DetermineNewsAction() return NS_OK; } - if (PL_strcasestr(path.get(), "?part=")) { - // news://news.mozilla.org:119/3B98D201.3020100@cs.com?part=1 + if (PL_strcasestr(path.get(), "?part=") || PL_strcasestr(path.get(), "&part=")) { + // news://news.mozilla.org:119/3B98D201.3020100%40cs.com?part=1 + // news://news.mozilla.org:119/b58dme%24aia2%40ripley.netscape.com?header=print&part=1.2&type=image/jpeg&filename=Pole.jpg m_newsAction = nsINntpUrl::ActionFetchPart; return NS_OK; }