xpath BUGFIX expr repeat dup
diff --git a/src/xpath.c b/src/xpath.c
index 276ca6b..9d3d74d 100644
--- a/src/xpath.c
+++ b/src/xpath.c
@@ -3189,7 +3189,7 @@
{
LY_ERR ret = LY_SUCCESS;
struct lyxp_expr *dup = NULL;
- uint32_t used = 0, i, j, k, expr_len;
+ uint32_t used = 0, i, j, expr_len;
const char *expr_start;
assert((!start_idx && !end_idx) || ((start_idx < exp->used) && (end_idx < exp->used) && (start_idx <= end_idx)));
@@ -3244,14 +3244,6 @@
dup->repeat[i - start_idx] = malloc(j * sizeof **dup->repeat);
LY_CHECK_ERR_GOTO(!dup->repeat[i - start_idx], LOGMEM(ctx); ret = LY_EMEM, cleanup);
memcpy(dup->repeat[i - start_idx], exp->repeat[i], j * sizeof **dup->repeat);
- dup->repeat[i - start_idx][j - 1] = 0;
-
- if (start_idx) {
- /* fix the indices in the tokens */
- for (k = 0; k < j; ++k) {
- dup->repeat[i - start_idx][k] -= start_idx;
- }
- }
}
}
}