| 965 | */ |
| 966 | |
| 967 | LIST * builtin_split_by_characters( FRAME * frame, int flags ) |
| 968 | { |
| 969 | LIST * l1 = lol_get( frame->args, 0 ); |
| 970 | LIST * l2 = lol_get( frame->args, 1 ); |
| 971 | |
| 972 | LIST * result = L0; |
| 973 | |
| 974 | string buf[ 1 ]; |
| 975 | |
| 976 | char const * delimiters = object_str( list_front( l2 ) ); |
| 977 | char * t; |
| 978 | |
| 979 | string_copy( buf, object_str( list_front( l1 ) ) ); |
| 980 | |
| 981 | t = strtok( buf->value, delimiters ); |
| 982 | while ( t ) |
| 983 | { |
| 984 | result = list_push_back( result, object_new( t ) ); |
| 985 | t = strtok( NULL, delimiters ); |
| 986 | } |
| 987 | |
| 988 | string_free( buf ); |
| 989 | |
| 990 | return result; |
| 991 | } |
| 992 | |
| 993 | |
| 994 | /* |
nothing calls this directly
no test coverage detected