| 1127 | } |
| 1128 | |
| 1129 | static LIST * apply_modifiers_non_empty( LIST * result, string * buf, |
| 1130 | VAR_EDITS * edits, int32_t n, LISTITER begin, LISTITER end ) |
| 1131 | { |
| 1132 | int32_t i; |
| 1133 | LISTITER iter; |
| 1134 | for ( i = 0; i < n; ++i ) |
| 1135 | { |
| 1136 | if ( edits[ i ].join.ptr ) |
| 1137 | { |
| 1138 | var_edit_file( object_str( list_item( begin ) ), buf, edits + i ); |
| 1139 | var_edit_shift( buf, 0, edits + i ); |
| 1140 | for ( iter = list_next( begin ); iter != end; iter = list_next( iter |
| 1141 | ) ) |
| 1142 | { |
| 1143 | int32_t size; |
| 1144 | string_append( buf, edits[ i ].join.ptr ); |
| 1145 | size = buf->size; |
| 1146 | var_edit_file( object_str( list_item( iter ) ), buf, edits + i |
| 1147 | ); |
| 1148 | var_edit_shift( buf, size, edits + i ); |
| 1149 | } |
| 1150 | result = list_push_back( result, object_new( buf->value ) ); |
| 1151 | string_truncate( buf, 0 ); |
| 1152 | } |
| 1153 | else |
| 1154 | { |
| 1155 | for ( iter = begin; iter != end; iter = list_next( iter ) ) |
| 1156 | { |
| 1157 | var_edit_file( object_str( list_item( iter ) ), buf, edits + i ); |
| 1158 | var_edit_shift( buf, 0, edits + i ); |
| 1159 | result = list_push_back( result, object_new( buf->value ) ); |
| 1160 | string_truncate( buf, 0 ); |
| 1161 | } |
| 1162 | } |
| 1163 | } |
| 1164 | return result; |
| 1165 | } |
| 1166 | |
| 1167 | static VAR_EXPANDED apply_modifiers_impl( LIST * result, string * buf, |
| 1168 | VAR_EDITS * edits, int32_t n, LISTITER iter, LISTITER end ) |
no test coverage detected