jed-users mailing list

[2003 Date Index] [2003 Thread Index] [Other years]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]

Re: misc.sl, directory() and array_map()


Klaus Schmid <klaus.schmid@xxxxxx> wrote:
>Problems found in in lib/misc.sl, directory():
>
>- If argument is an invalid path (listdir returns NULL)
>an error occurs in array_map.
>
>- If there are no files (listdir returns String_Type[0])
>an error occurs in array_map.

After the call to listdir, add:


   if ((files == NULL) or (length (files) == 0))
     return 0;

>- Line 109:
>      if (is_substr (ch, "[]\\^$+"))
>arguments seem to be twisted.

   Yep.

>Would it make sense to change the behaviour of
>array_map to return a zero-length-array if the argument
>is also a zero-length-array?

S-Lang 2 will fix this behavior.

Thanks,
--John

--------------------------
To unsubscribe send email to <jed-users-request@xxxxxxxxxxx> with
the word "unsubscribe" in the message body.
Need help? Email <jed-users-owner@xxxxxxxxxxx>.


[2003 date index] [2003 thread index]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]