Author: gert
Date: 2006-05-17 14:33:43 -0400 (Wed, 17 May 2006)
New Revision: 60797

Added:
   trunk/mcs/tests/test-513.cs
Modified:
   trunk/mcs/gmcs/ChangeLog
   trunk/mcs/gmcs/driver.cs
   trunk/mcs/mcs/ChangeLog
   trunk/mcs/mcs/driver.cs
   trunk/mcs/tests/ChangeLog
Log:
* driver.cs: Pass filename without path to AssemblyBuilder's
AddResourceFile. Fixes bug #78407.
* test-513.cs: New test for bug #78407.


Modified: trunk/mcs/gmcs/ChangeLog
===================================================================
--- trunk/mcs/gmcs/ChangeLog    2006-05-17 18:30:38 UTC (rev 60796)
+++ trunk/mcs/gmcs/ChangeLog    2006-05-17 18:33:43 UTC (rev 60797)
@@ -1,3 +1,8 @@
+2006-05-17  Gert Driesen  <[EMAIL PROTECTED]>
+
+       * driver.cs: Paass filename without path to AssemblyBuilder's
+       AddResourceFile. Fixes bug #78407.
+
 2006-05-17  Raja R Harinath  <[EMAIL PROTECTED]>
 
        * statement.cs (LabeledStatement.Resolve): Move merging of origins ...

Modified: trunk/mcs/gmcs/driver.cs
===================================================================
--- trunk/mcs/gmcs/driver.cs    2006-05-17 18:30:38 UTC (rev 60796)
+++ trunk/mcs/gmcs/driver.cs    2006-05-17 18:33:43 UTC (rev 60797)
@@ -1898,7 +1898,7 @@
 
                        public void Emit ()
                        {
-                               CodeGen.Assembly.Builder.AddResourceFile (name, 
file, attribute);
+                               CodeGen.Assembly.Builder.AddResourceFile (name, 
Path.GetFileName(file), attribute);
                        }
 
                        public string FileName {

Modified: trunk/mcs/mcs/ChangeLog
===================================================================
--- trunk/mcs/mcs/ChangeLog     2006-05-17 18:30:38 UTC (rev 60796)
+++ trunk/mcs/mcs/ChangeLog     2006-05-17 18:33:43 UTC (rev 60797)
@@ -1,3 +1,8 @@
+2006-05-17  Gert Driesen  <[EMAIL PROTECTED]>
+
+       * driver.cs: Pass filename without path to AssemblyBuilder's 
+       AddResourceFile. Fixes bug #78407.
+
 2006-05-17  Raja R Harinath  <[EMAIL PROTECTED]>
 
        * statement.cs (LabeledStatement.Resolve): Move merging of origins ...

Modified: trunk/mcs/mcs/driver.cs
===================================================================
--- trunk/mcs/mcs/driver.cs     2006-05-17 18:30:38 UTC (rev 60796)
+++ trunk/mcs/mcs/driver.cs     2006-05-17 18:33:43 UTC (rev 60797)
@@ -1895,7 +1895,7 @@
 
                        public void Emit ()
                        {
-                               CodeGen.Assembly.Builder.AddResourceFile (name, 
file, attribute);
+                               CodeGen.Assembly.Builder.AddResourceFile (name, 
Path.GetFileName(file), attribute);
                        }
 
                        public string FileName {

Modified: trunk/mcs/tests/ChangeLog
===================================================================
--- trunk/mcs/tests/ChangeLog   2006-05-17 18:30:38 UTC (rev 60796)
+++ trunk/mcs/tests/ChangeLog   2006-05-17 18:33:43 UTC (rev 60797)
@@ -1,3 +1,7 @@
+2006-05-17  Gert Driesen  <[EMAIL PROTECTED]>
+
+       * test-513.cs: New test for bug #78407.
+
 2006-05-16  Raja R Harinath  <[EMAIL PROTECTED]>
 
        * test-511.cs, test-512.cs: New tests from #76632.

Added: trunk/mcs/tests/test-513.cs
===================================================================
--- trunk/mcs/tests/test-513.cs 2006-05-17 18:30:38 UTC (rev 60796)
+++ trunk/mcs/tests/test-513.cs 2006-05-17 18:33:43 UTC (rev 60797)
@@ -0,0 +1,48 @@
+// Compiler options: -linkresource:test-513.cs -linkresource:test-512.cs 
-linkresource:./test-511.cs,test
+
+using System;
+using System.IO;
+using System.Reflection;
+
+public class Test
+{
+       static int Main ()
+       {
+               Assembly a = Assembly.GetExecutingAssembly ();
+               string[] resourceNames = a.GetManifestResourceNames ();
+               if (resourceNames.Length != 3)
+                       return 1;
+               if (resourceNames[0] != "test-513.cs")
+                       return 1;
+               if (resourceNames[1] != "test-512.cs")
+                       return 1;
+               if (resourceNames[2] != "test")
+                       return 1;
+               FileStream f = a.GetFile ("test-513.cs");
+               if (f == null)
+                       return 1;
+               f = a.GetFile ("test-512.cs");
+               if (f == null)
+                       return 1;
+               f = a.GetFile ("test-511.cs");
+               if (f == null)
+                       return 1;
+               f = a.GetFile ("test");
+               if (f != null)
+                       return 1;
+               Stream s = a.GetManifestResourceStream ("test-513.cs");
+               if (s == null)
+                       return 1;
+               s = a.GetManifestResourceStream ("test-512.cs");
+               if (s == null)
+                       return 1;
+               s = a.GetManifestResourceStream ("test");
+               if (s == null)
+                       return 1;
+               s = a.GetManifestResourceStream ("test-511.cs");
+               if (s != null)
+                       return 1;
+               
+               return 0;
+       }
+}


Property changes on: trunk/mcs/tests/test-513.cs
___________________________________________________________________
Name: svn:eol-style
   + native

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to