test/harness/testcaseinput.c
changeset 184 cd3068704d3a
parent 35 51a0beae92f6
     1.1 --- a/test/harness/testcaseinput.c	Mon Feb 20 08:13:47 2012 +0000
     1.2 +++ b/test/harness/testcaseinput.c	Sun Oct 20 21:06:25 2013 +0100
     1.3 @@ -76,9 +76,15 @@
     1.4      {
     1.5  	if (testcase->encoding)
     1.6  	{
     1.7 -	    t=unix2dos(input->contents);
     1.8 -	    s=g_convert(t,-1,testcase->encoding,"UTF-8",NULL,&n,&tmp_err);
     1.9 -	    g_free(t);
    1.10 +	    if (testcase->flags&TESTCASE_UNIX_NEWLINES)
    1.11 +		s=g_convert(input->contents,-1,testcase->encoding,"UTF-8",NULL,
    1.12 +		  &n,&tmp_err);
    1.13 +	    else
    1.14 +	    {
    1.15 +		t=unix2dos(input->contents);
    1.16 +		s=g_convert(t,-1,testcase->encoding,"UTF-8",NULL,&n,&tmp_err);
    1.17 +		g_free(t);
    1.18 +	    }
    1.19  	    if (!s)
    1.20  	    {
    1.21  		g_propagate_prefixed_error(error,tmp_err,
    1.22 @@ -86,6 +92,11 @@
    1.23  		return FALSE;
    1.24  	    }
    1.25  	}
    1.26 +	else if (testcase->flags&TESTCASE_UNIX_NEWLINES)
    1.27 +	{
    1.28 +	    s=g_strdup(input->contents);
    1.29 +	    n=strlen(s);
    1.30 +	}
    1.31  	else
    1.32  	{
    1.33  	    s=unix2dos(input->contents);