| 1056 | } |
| 1057 | |
| 1058 | static LIST * apply_modifiers_non_empty( LIST * result, string * buf, |
| 1059 | VAR_EDITS * edits, int n, LISTITER begin, LISTITER end ) |
| 1060 | { |
| 1061 | int i; |
| 1062 | LISTITER iter; |
| 1063 | for ( i = 0; i < n; ++i ) |
| 1064 | { |
| 1065 | if ( edits[ i ].join.ptr ) |
| 1066 | { |
| 1067 | var_edit_file( object_str( list_item( begin ) ), buf, edits + i ); |
| 1068 | var_edit_shift( buf, 0, edits + i ); |
| 1069 | for ( iter = list_next( begin ); iter != end; iter = list_next( iter |
| 1070 | ) ) |
| 1071 | { |
| 1072 | size_t size; |
| 1073 | string_append( buf, edits[ i ].join.ptr ); |
| 1074 | size = buf->size; |
| 1075 | var_edit_file( object_str( list_item( iter ) ), buf, edits + i |
| 1076 | ); |
| 1077 | var_edit_shift( buf, size, edits + i ); |
| 1078 | } |
| 1079 | result = list_push_back( result, object_new( buf->value ) ); |
| 1080 | string_truncate( buf, 0 ); |
| 1081 | } |
| 1082 | else |
| 1083 | { |
| 1084 | for ( iter = begin; iter != end; iter = list_next( iter ) ) |
| 1085 | { |
| 1086 | var_edit_file( object_str( list_item( iter ) ), buf, edits + i ); |
| 1087 | var_edit_shift( buf, 0, edits + i ); |
| 1088 | result = list_push_back( result, object_new( buf->value ) ); |
| 1089 | string_truncate( buf, 0 ); |
| 1090 | } |
| 1091 | } |
| 1092 | } |
| 1093 | return result; |
| 1094 | } |
| 1095 | |
| 1096 | static LIST * apply_modifiers_impl( LIST * result, string * buf, |
| 1097 | VAR_EDITS * edits, int n, LISTITER iter, LISTITER end ) |
no test coverage detected