On Fri, 27 Sep 2013 22:23:43 +0200, Mike Wey wrote:
How is toStringArray limited to 10 strings?
In src/glib/Str.d
at line 190:
public static string[] toStringArray(char** args)
{
if ( args is null )
{
return null;
}
string[] argv;
char* arg = args[0];
int i=0;
while( (arg) != null && i<10)
{
argv ~= toString(arg);
++i;
arg = args[i];
}
return argv;
}
Because of the i
in the while
loop. As long as arg
points to a valid string and i<10
concat to argv. If i==10
stop looping even if arg points to a valid string.
I don't know if this is an arbitrary limit or some underlying need for that limit.