Author: leo
Date: Wed Apr 13 02:16:41 2005
New Revision: 7823

Modified:
   trunk/src/library.c
Log:
[perl #34937] [PATCH] Absolute library paths on Win32

This patch makes Parrot recognise /path/to/file and c:/path/to/file as
absolute paths on Win32 (so that e.g. 'load_bytecode "c:/path/to/file"'
can be used instead of 'load_bytecode "c:\\path/to/file"')

Courtesy of Philip Taylor <[EMAIL PROTECTED]>


Modified: trunk/src/library.c
==============================================================================
--- trunk/src/library.c (original)
+++ trunk/src/library.c Wed Apr 13 02:16:41 2005
@@ -202,8 +202,10 @@
 
     /* use absolute paths as is */
 #ifdef WIN32
-    if (file_name[0] == '\\' || (isalpha(file_name[0]) &&
-                strncmp(file_name+1, ":\\", 2) == 0)) {
+    if (file_name[0] == '\\' || file_name[0] == '/' ||
+        (isalpha(file_name[0]) &&
+            (strncmp(file_name+1, ":\\", 2) == 0 ||
+             strncmp(file_name+1, ":/",  2) == 0))) {
 #else
     if (file_name[0] == '/') {
 #endif

Reply via email to