Index: lyx-devel/src/tex2lyx/tex2lyx.cpp
===================================================================
--- lyx-devel/src/tex2lyx/tex2lyx.cpp	(revision 18751)
+++ lyx-devel/src/tex2lyx/tex2lyx.cpp	(working copy)
@@ -306,7 +306,7 @@
 		cerr << "Missing syntaxfile string after -s switch" << endl;
 		exit(1);
 	}
-	syntaxfile = arg;
+	syntaxfile = lyx::support::os::internal_path(arg);
 	return 1;
 }
 
@@ -323,7 +323,7 @@
 		cerr << "Missing directory for -sysdir switch" << endl;
 		exit(1);
 	}
-	cl_system_support = arg;
+	cl_system_support = lyx::support::os::internal_path(arg);
 	return 1;
 }
 
@@ -334,7 +334,7 @@
 		cerr << "Missing directory for -userdir switch" << endl;
 		exit(1);
 	}
-	cl_user_support = arg;
+	cl_user_support = lyx::support::os::internal_path(arg);
 	return 1;
 }
 
@@ -512,7 +512,7 @@
 
 	lyx::support::os::init(argc, argv);
 
-	try { support::init_package(to_utf8(from_local8bit(argv[0])),
+	try { support::init_package(lyx::support::os::internal_path(to_utf8(from_local8bit(argv[0]))),
 		cl_system_support, cl_user_support,
 		support::top_build_dir_is_two_levels_up);
 	} catch (support::ExceptionMessage const & message) {
@@ -521,18 +521,20 @@
 		if (message.type_ == support::ErrorException)
 			exit(1);
 	}
-
+	
 	// Now every known option is parsed. Look for input and output
 	// file name (the latter is optional).
-	string const infilename = makeAbsPath(to_utf8(from_local8bit(argv[1]))).absFilename();
+	string infilename = lyx::support::os::internal_path(to_utf8(from_local8bit(argv[1])));
+	infilename = makeAbsPath(infilename).absFilename();
+	
 	string outfilename;
 	if (argc > 2) {
-		outfilename = to_utf8(from_local8bit(argv[2]));
+		outfilename = lyx::support::os::internal_path(to_utf8(from_local8bit(argv[2])));
 		if (outfilename != "-")
-			outfilename = makeAbsPath(to_utf8(from_local8bit(argv[2]))).absFilename();
+			outfilename = makeAbsPath(outfilename).absFilename();
 	} else
 		outfilename = changeExtension(infilename, ".lyx");
-
+		
 	FileName const system_syntaxfile = lyx::support::libFileSearch("", "syntax.default");
 	if (system_syntaxfile.empty()) {
 		cerr << "Error: Could not find syntax file \"syntax.default\"." << endl;
