diff --git a/toolkit/components/commandlines/src/nsCommandLine.cpp b/toolkit/components/commandlines/src/nsCommandLine.cpp index c4b79330150..70e34dcf455 100644 --- a/toolkit/components/commandlines/src/nsCommandLine.cpp +++ b/toolkit/components/commandlines/src/nsCommandLine.cpp @@ -95,7 +95,6 @@ protected: void *aClosure); void appendArg(const char* arg); - void resolveShortcutURL(nsILocalFile* aFile, nsACString& outURL); nsresult EnumerateHandlers(EnumerateHandlersCallback aCallback, void *aClosure); nsresult EnumerateValidators(EnumerateValidatorsCallback aCallback, void *aClosure); @@ -443,28 +442,18 @@ nsCommandLine::ResolveURI(const nsAString& aArgument, nsIURI* *aResult) nsCOMPtr io = do_GetIOService(); NS_ENSURE_TRUE(io, NS_ERROR_OUT_OF_MEMORY); - nsCOMPtr workingDirURI; - if (mWorkingDir) { - io->NewFileURI(mWorkingDir, getter_AddRefs(workingDirURI)); - } - nsCOMPtr lf (do_CreateInstance(NS_LOCAL_FILE_CONTRACTID)); rv = lf->InitWithPath(aArgument); if (NS_SUCCEEDED(rv)) { lf->Normalize(); - nsCAutoString url; - // Try to resolve the url for .url files. - resolveShortcutURL(lf, url); - if (!url.IsEmpty()) { - return io->NewURI(url, - nsnull, - workingDirURI, - aResult); - } - return io->NewFileURI(lf, aResult); } + nsCOMPtr workingDirURI; + if (mWorkingDir) { + io->NewFileURI(mWorkingDir, getter_AddRefs(workingDirURI)); + } + return io->NewURI(NS_ConvertUTF16toUTF8(aArgument), nsnull, workingDirURI, @@ -488,22 +477,6 @@ nsCommandLine::appendArg(const char* arg) mArgs.AppendString(warg); } -void -nsCommandLine::resolveShortcutURL(nsILocalFile* aFile, nsACString& outURL) -{ - nsCOMPtr fph; - nsresult rv = NS_GetFileProtocolHandler(getter_AddRefs(fph)); - if (NS_FAILED(rv)) - return; - - nsCOMPtr uri; - rv = fph->ReadURLFile(aFile, getter_AddRefs(uri)); - if (NS_FAILED(rv)) - return; - - uri->GetSpec(outURL); -} - NS_IMETHODIMP nsCommandLine::Init(PRInt32 argc, char** argv, nsIFile* aWorkingDir, PRUint32 aState) diff --git a/toolkit/components/commandlines/test/Makefile.in b/toolkit/components/commandlines/test/Makefile.in index 09eccc7551e..1e2e001845e 100644 --- a/toolkit/components/commandlines/test/Makefile.in +++ b/toolkit/components/commandlines/test/Makefile.in @@ -45,16 +45,9 @@ VPATH = @srcdir@ include $(DEPTH)/config/autoconf.mk MODULE = test_harness_commandlines -TESTROOT = $(shell cd $(DEPTH) && pwd)/_tests/xpcshell-simple/$(MODULE) XPCSHELL_TESTS = \ unit \ $(NULL) include $(topsrcdir)/config/rules.mk - -ifneq (,$(filter-out OS2 Darwin,$(OS_ARCH))) -# Hack to allow preprocessing of test_bug410156.js -libs:: unit/test_bug410156.js.in - $(PYTHON) $(MOZILLA_DIR)/config/Preprocessor.py $(DEFINES) $(ACDEFINES) $^ > $(TESTROOT)/unit/test_bug410156.js -endif