@@ -6195,10 +6195,8 @@ static bool fn_accept_2(query *q)
6195
6195
return unify (q , p1 , p1_ctx , & tmp , q -> st .curr_frame );
6196
6196
}
6197
6197
6198
- static bool do_parse_parts (query * q , bool full )
6198
+ static bool do_parse_parts (query * q , cell * p1 , pl_idx p1_ctx , cell * p2 , pl_idx p2_ctx , bool full )
6199
6199
{
6200
- GET_FIRST_ARG (p1 ,atom_or_var );
6201
- GET_NEXT_ARG (p2 ,iso_list );
6202
6200
char protocol [256 ], host [1024 ], path [8192 ], search [8192 ], fragment [8192 ];
6203
6201
protocol [0 ] = host [0 ] = path [0 ] = search [0 ] = fragment [0 ] = '\0' ;
6204
6202
int port = 0 ;
@@ -6317,11 +6315,8 @@ static bool do_parse_parts(query *q, bool full)
6317
6315
return unify (q , p1 , p1_ctx , & tmp , q -> st .curr_frame );
6318
6316
}
6319
6317
6320
- static bool do_parse_url (query * q , bool full )
6318
+ static bool do_parse_url (query * q , cell * p1 , pl_idx p1_ctx , cell * p2 , pl_idx p2_ctx , bool full )
6321
6319
{
6322
- GET_FIRST_ARG (p1 ,atom );
6323
- GET_NEXT_ARG (p2 ,iso_list_or_var );
6324
-
6325
6320
const char * src = C_STR (q , p1 );
6326
6321
char protocol [256 ], host [1024 ], path [8192 ], search [8192 ], fragment [8192 ];
6327
6322
protocol [0 ] = host [0 ] = path [0 ] = search [0 ] = fragment [0 ] = '\0' ;
@@ -6472,23 +6467,23 @@ static bool fn_parse_url_2(query *q)
6472
6467
return throw_error2 (q , p1 , p1_ctx , "uninstantiation_error" , "not_sufficiently_instantiated" , p2 );
6473
6468
6474
6469
if (is_var (p2 ))
6475
- return do_parse_url (q , true);
6470
+ return do_parse_url (q , p1 , p1_ctx , p2 , p2_ctx , true);
6476
6471
else
6477
- return do_parse_parts (q , true);
6472
+ return do_parse_parts (q , p1 , p1_ctx , p2 , p2_ctx , true);
6478
6473
}
6479
6474
6480
- static bool fn_parse_location_2 (query * q )
6475
+ static bool fn_http_location_2 (query * q )
6481
6476
{
6482
- GET_FIRST_ARG (p1 ,atom_or_var );
6483
- GET_NEXT_ARG (p2 ,iso_list_or_var );
6477
+ GET_FIRST_ARG (p1 ,iso_list_or_var );
6478
+ GET_NEXT_ARG (p2 ,atom_or_var );
6484
6479
6485
6480
if (is_var (p1 ) && is_var (p2 ))
6486
6481
return throw_error2 (q , p1 , p1_ctx , "uninstantiation_error" , "not_sufficiently_instantiated" , p2 );
6487
6482
6488
- if (is_var (p2 ))
6489
- return do_parse_url (q , false);
6483
+ if (is_var (p1 ))
6484
+ return do_parse_url (q , p2 , p2_ctx , p1 , p1_ctx , false);
6490
6485
else
6491
- return do_parse_parts (q , false);
6486
+ return do_parse_parts (q , p2 , p2_ctx , p1 , p1_ctx , false);
6492
6487
}
6493
6488
6494
6489
static bool fn_client_5 (query * q )
@@ -7639,7 +7634,7 @@ builtins g_files_bifs[] =
7639
7634
{"read_line_to_string" , 2 , fn_read_line_to_string_2 , "+stream,-character_list" , false, false, BLAH },
7640
7635
{"read_file_to_string" , 3 , fn_read_file_to_string_3 , "+atom,-string,+options" , false, false, BLAH },
7641
7636
7642
- {"parse_location " , 2 , fn_parse_location_2 , "?atom,?list " , false, false, BLAH },
7637
+ {"http_location " , 2 , fn_http_location_2 , "?list,?atom " , false, false, BLAH },
7643
7638
{"parse_url" , 2 , fn_parse_url_2 , "?atom,?list" , false, false, BLAH },
7644
7639
{"client" , 5 , fn_client_5 , "+atom,-atom,-atom,-atom,+list" , false, false, BLAH },
7645
7640
{"server" , 3 , fn_server_3 , "+atom,--stream,+list" , false, false, BLAH },
0 commit comments