2009/9/11 Allison Randal <[email protected]>:
> François Perrad wrote:
>>
>> I've refactored the language WMLScript with the opcode load_language.
>> That's work fine for dynops & dynpmc.
>>
>> But when I load the runtime standard libraries (in src/wmlsstdlibs.pir),
>> I always need the prefix 'library' in the path
>>
>> sub 'load_stdlibs'
>>    load_bytecode 'library/wmlslang.pbc'
>>    load_bytecode 'library/wmlsfloat.pbc'
>>    load_bytecode 'library/wmlsstring.pbc'
>>    load_bytecode 'library/wmlsconsole.pbc'
>>
>> What I missed ?
>
> You're not missing anything. Parrot was missing adding the language-specific
> library search path in 'load_language'. Try it after r41189.
>
> Allison
>

Parrot_str_substr doesn't work with negative offset.

So, I patched the call in src/packfile.c (line 4806).
It's just a workaround.

François.

>
Index: packfile.c
===================================================================
--- packfile.c	(revision 41199)
+++ packfile.c	(working copy)
@@ -4803,7 +4803,7 @@
     /* Add the include and dynext paths to the global search */
     parrot_split_path_ext(interp, path, &found_path, &found_ext);
     name_length = Parrot_str_length(interp, lang_name);
-    found_path = Parrot_str_substr(interp, found_path, -name_length, name_length, NULL, 0);
+    found_path = Parrot_str_substr(interp, found_path, 0, Parrot_str_length(interp, found_path)-name_length, NULL, 0);
     Parrot_lib_add_path(interp, Parrot_str_append(interp, found_path, CONST_STRING(interp, "include/")),
             PARROT_LIB_PATH_INCLUDE);
     Parrot_lib_add_path(interp, Parrot_str_append(interp, found_path, CONST_STRING(interp, "dynext/")),
_______________________________________________
http://lists.parrot.org/mailman/listinfo/parrot-dev

Reply via email to