@@ -379,41 +379,51 @@ binary_to_jid2(Jid, <<>>, N, S) ->
379
379
{erlang :binary_part (Jid , {0 , N }),
380
380
erlang :binary_part (Jid , {N + 1 , S }),
381
381
<<>>};
382
+ binary_to_jid2 (_ , <<$@ , _J /binary >>, _N , _ ) ->
383
+ error ;
382
384
binary_to_jid2 (_ , <<$/ , _J /binary >>, _N , 0 ) ->
383
385
error ;
384
386
binary_to_jid2 (Jid , <<$/ , _ /binary >>, N , S ) ->
385
387
{erlang :binary_part (Jid , {0 , N }),
386
388
erlang :binary_part (Jid , {N + 1 , S }),
387
389
erlang :binary_part (Jid , {N + S + 2 , byte_size (Jid ) - N - S - 2 })};
388
- binary_to_jid2 (Jid , <<_ , " /" , _ /binary >>, N , S ) ->
390
+ binary_to_jid2 (Jid , <<A , " /" , _ /binary >>, N , S )
391
+ when A =/= $@ ->
389
392
{erlang :binary_part (Jid , {0 , N }),
390
393
erlang :binary_part (Jid , {N + 1 , S + 1 }),
391
394
erlang :binary_part (Jid , {N + S + 3 , byte_size (Jid ) - N - S - 3 })};
392
- binary_to_jid2 (Jid , <<_ , _ , " /" , _ /binary >>, N , S ) ->
395
+ binary_to_jid2 (Jid , <<A , B , " /" , _ /binary >>, N , S )
396
+ when A =/= $@ , B =/= $@ ->
393
397
{erlang :binary_part (Jid , {0 , N }),
394
398
erlang :binary_part (Jid , {N + 1 , S + 2 }),
395
399
erlang :binary_part (Jid , {N + S + 4 , byte_size (Jid ) - N - S - 4 })};
396
- binary_to_jid2 (Jid , <<_ , _ , _ , " /" , _ /binary >>, N , S ) ->
400
+ binary_to_jid2 (Jid , <<A , B , C , " /" , _ /binary >>, N , S )
401
+ when A =/= $@ , B =/= $@ , C =/= $@ ->
397
402
{erlang :binary_part (Jid , {0 , N }),
398
403
erlang :binary_part (Jid , {N + 1 , S + 3 }),
399
404
erlang :binary_part (Jid , {N + S + 5 , byte_size (Jid ) - N - S - 5 })};
400
- binary_to_jid2 (Jid , <<_ , _ , _ , _ , " /" , _ /binary >>, N , S ) ->
405
+ binary_to_jid2 (Jid , <<A , B , C , D , " /" , _ /binary >>, N , S )
406
+ when A =/= $@ , B =/= $@ , C =/= $@ , D =/= $@ ->
401
407
{erlang :binary_part (Jid , {0 , N }),
402
408
erlang :binary_part (Jid , {N + 1 , S + 4 }),
403
409
erlang :binary_part (Jid , {N + S + 6 , byte_size (Jid ) - N - S - 6 })};
404
- binary_to_jid2 (Jid , <<_ , _ , _ , _ , _ , " /" , _ /binary >>, N , S ) ->
410
+ binary_to_jid2 (Jid , <<A , B , C , D , E , " /" , _ /binary >>, N , S )
411
+ when A =/= $@ , B =/= $@ , C =/= $@ , D =/= $@ , E =/= $@ ->
405
412
{erlang :binary_part (Jid , {0 , N }),
406
413
erlang :binary_part (Jid , {N + 1 , S + 5 }),
407
414
erlang :binary_part (Jid , {N + S + 7 , byte_size (Jid ) - N - S - 7 })};
408
- binary_to_jid2 (Jid , <<_ , _ , _ , _ , _ , _ , " /" , _ /binary >>, N , S ) ->
415
+ binary_to_jid2 (Jid , <<A , B , C , D , E , F , " /" , _ /binary >>, N , S )
416
+ when A =/= $@ , B =/= $@ , C =/= $@ , D =/= $@ , E =/= $@ , F =/= $@ ->
409
417
{erlang :binary_part (Jid , {0 , N }),
410
418
erlang :binary_part (Jid , {N + 1 , S + 6 }),
411
419
erlang :binary_part (Jid , {N + S + 8 , byte_size (Jid ) - N - S - 8 })};
412
- binary_to_jid2 (Jid , <<_ , _ , _ , _ , _ , _ , _ , " /" , _ /binary >>, N , S ) ->
420
+ binary_to_jid2 (Jid , <<A , B , C , D , E , F , G , " /" , _ /binary >>, N , S )
421
+ when A =/= $@ , B =/= $@ , C =/= $@ , D =/= $@ , E =/= $@ , F =/= $@ , G =/= $@ ->
413
422
{erlang :binary_part (Jid , {0 , N }),
414
423
erlang :binary_part (Jid , {N + 1 , S + 7 }),
415
424
erlang :binary_part (Jid , {N + S + 9 , byte_size (Jid ) - N - S - 9 })};
416
- binary_to_jid2 (Jid , <<_ , _ , _ , _ , _ , _ , _ , _ , J /binary >>, N , S ) ->
425
+ binary_to_jid2 (Jid , <<A , B , C , D , E , F , G , H , J /binary >>, N , S )
426
+ when A =/= $@ , B =/= $@ , C =/= $@ , D =/= $@ , E =/= $@ , F =/= $@ , G =/= $@ , H =/= $@ ->
417
427
binary_to_jid2 (Jid , J , N , S + 8 );
418
428
binary_to_jid2 (Jid , <<_C , J /binary >>, N , S ) ->
419
429
binary_to_jid2 (Jid , J , N , S + 1 ).
0 commit comments