--- var.c 2003/02/10 20:38:18 1.93
+++ var.c 2003/02/10 20:50:53 1.94
@@ -799,11 +799,11 @@
goto error_return;
if (rc > 0) {
p += rc;
- if (!tokenbuf_append
- (result, tmp.begin, tmp.end - tmp.begin)) {
+ if (!tokenbuf_merge(result, &tmp)) {
rc = VAR_ERR_OUT_OF_MEMORY;
goto error_return;
}
+ tokenbuf_free(&tmp);
}
} while (rc > 0);
@@ -1091,7 +1091,7 @@
return rc;
}
/* append replace string */
- if (!tokenbuf_append(&tmp, myreplace.begin, myreplace.end - myreplace.begin)) {
+ if (!tokenbuf_merge(&tmp, &myreplace)) {
regfree(&preg);
tokenbuf_free(&tmp);
tokenbuf_free(&mydata);
@@ -1215,7 +1215,7 @@
if (i > 0) {
i = i / (fill->end - fill->begin);
while (i > 0) {
- if (!tokenbuf_append(&result, fill->begin, fill->end - fill->begin)) {
+ if (!tokenbuf_merge(&result, fill)) {
tokenbuf_free(&result);
return VAR_ERR_OUT_OF_MEMORY;
}
@@ -1226,7 +1226,7 @@
tokenbuf_free(&result);
return VAR_ERR_OUT_OF_MEMORY;
}
- if (!tokenbuf_append(&result, data->begin, data->end - data->begin)) {
+ if (!tokenbuf_merge(&result, data)) {
tokenbuf_free(&result);
return VAR_ERR_OUT_OF_MEMORY;
}
@@ -1241,7 +1241,7 @@
/* create the prefix */
i = i / (fill->end - fill->begin);
while (i > 0) {
- if (!tokenbuf_append(&result, fill->begin, fill->end - fill->begin)) {
+ if (!tokenbuf_merge(&result, fill)) {
tokenbuf_free(&result);
return VAR_ERR_OUT_OF_MEMORY;
}
@@ -1254,7 +1254,7 @@
return VAR_ERR_OUT_OF_MEMORY;
}
/* append the actual data string */
- if (!tokenbuf_append(&result, data->begin, data->end - data->begin)) {
+ if (!tokenbuf_merge(&result, data)) {
tokenbuf_free(&result);
return VAR_ERR_OUT_OF_MEMORY;
}
@@ -1262,7 +1262,7 @@
i = width - (result.end - result.begin);
i = i / (fill->end - fill->begin);
while (i > 0) {
- if (!tokenbuf_append(&result, fill->begin, fill->end - fill->begin)) {
+ if (!tokenbuf_merge(&result, fill)) {
tokenbuf_free(&result);
return VAR_ERR_OUT_OF_MEMORY;
}
|