2005-09-28 Marek Safar <marek.safar@seznam.cz>
authorMarek Safar <marek.safar@gmail.com>
Wed, 28 Sep 2005 12:42:41 +0000 (12:42 -0000)
committerMarek Safar <marek.safar@gmail.com>
Wed, 28 Sep 2005 12:42:41 +0000 (12:42 -0000)
Fix #76255.
* driver.cs: Fix compilation files with full root path.

svn path=/trunk/mcs/; revision=50939

mcs/mcs/driver.cs

index 083c48104d74f020efb1fb530270389cdb693a8d..8dbdd8782face2103c3ffe9a62c54560a29d1008 100644 (file)
@@ -1320,10 +1320,14 @@ namespace Mono.CSharp
                                return true;
                        }
 
-                       Report.Error (2007, "Unrecognized command-line option: `{0}'", option);
                        return false;
                }
 
+               static void Error_WrongOption (string option)
+               {
+                       Report.Error (2007, "Unrecognized command-line option: `{0}'", option);
+               }
+
                static string [] AddArgs (string [] args, string [] extra_args)
                {
                        string [] new_args;
@@ -1434,13 +1438,19 @@ namespace Mono.CSharp
                                                string csc_opt = "/" + arg.Substring (1);
                                                if (CSCParseOption (csc_opt, ref args, ref i))
                                                        continue;
+
+                                               Error_WrongOption (arg);
                                                return false;
                                        } else {
-                                               // Need to skip `/home/test.cs' however /test.cs is considered as error
-                                               if (arg [0] == '/' && (arg.Length < 2 ||  arg.IndexOf ('/', 2) == -1)){
+                                               if (arg [0] == '/'){
                                                        if (CSCParseOption (arg, ref args, ref i))
                                                                continue;
-                                                       return false;
+
+                                                       // Need to skip `/home/test.cs' however /test.cs is considered as error
+                                                       if (arg.Length < 2 || arg.IndexOf ('/', 2) == -1) {
+                                                               Error_WrongOption (arg);
+                                                               return false;
+                                                       }
                                                }
                                        }
                                }