diff --git a/mozilla/layout/forms/nsFileControlFrame.cpp b/mozilla/layout/forms/nsFileControlFrame.cpp index 42e46dd75f4..9b11a653958 100644 --- a/mozilla/layout/forms/nsFileControlFrame.cpp +++ b/mozilla/layout/forms/nsFileControlFrame.cpp @@ -163,7 +163,11 @@ void nsFileControlFrame::MouseClicked(nsIPresContext* aPresContext) if (result) { nsFileSpec fileSpec; fileWidget->GetFile(fileSpec); - mTextFrame->SetProperty(nsHTMLAtoms::value,fileSpec.GetNativePathCString()); + char* leafName = fileSpec.GetLeafName(); + if (leafName) { + mTextFrame->SetProperty(nsHTMLAtoms::value,leafName); + nsCRT::free(leafName); + } } NS_RELEASE(fileWidget); } diff --git a/mozilla/layout/html/forms/src/nsFileControlFrame.cpp b/mozilla/layout/html/forms/src/nsFileControlFrame.cpp index 42e46dd75f4..9b11a653958 100644 --- a/mozilla/layout/html/forms/src/nsFileControlFrame.cpp +++ b/mozilla/layout/html/forms/src/nsFileControlFrame.cpp @@ -163,7 +163,11 @@ void nsFileControlFrame::MouseClicked(nsIPresContext* aPresContext) if (result) { nsFileSpec fileSpec; fileWidget->GetFile(fileSpec); - mTextFrame->SetProperty(nsHTMLAtoms::value,fileSpec.GetNativePathCString()); + char* leafName = fileSpec.GetLeafName(); + if (leafName) { + mTextFrame->SetProperty(nsHTMLAtoms::value,leafName); + nsCRT::free(leafName); + } } NS_RELEASE(fileWidget); }