mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -05:00
[document] add_string_to_string
This commit is contained in:
parent
5d394926bd
commit
d4157366b0
@ -562,14 +562,14 @@ string_replace(struct string *res, struct string *inp, struct string *what, stru
|
|||||||
init_string(&tmp);
|
init_string(&tmp);
|
||||||
init_string(&tmp2);
|
init_string(&tmp2);
|
||||||
|
|
||||||
add_to_string(&tmp,inp->source);
|
add_string_to_string(&tmp, inp);
|
||||||
|
|
||||||
head = tmp.source;
|
head = tmp.source;
|
||||||
int count = 0;
|
int count = 0;
|
||||||
ins = head;
|
ins = head;
|
||||||
if (what->length==0)
|
if (what->length==0)
|
||||||
{
|
{
|
||||||
add_to_string(res,inp->source);
|
add_string_to_string(res, inp);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -594,13 +594,13 @@ string_replace(struct string *res, struct string *inp, struct string *what, stru
|
|||||||
// clear tmp string and tmp2 string
|
// clear tmp string and tmp2 string
|
||||||
done_string(&tmp);
|
done_string(&tmp);
|
||||||
init_string(&tmp);
|
init_string(&tmp);
|
||||||
add_to_string(&tmp,tmp2.source);
|
add_string_to_string(&tmp, &tmp2);
|
||||||
done_string(&tmp2);
|
done_string(&tmp2);
|
||||||
init_string(&tmp2);
|
init_string(&tmp2);
|
||||||
//printf("TMP: %s |\n",tmp.source);
|
//printf("TMP: %s |\n",tmp.source);
|
||||||
head = tmp.source;
|
head = tmp.source;
|
||||||
}
|
}
|
||||||
add_to_string(res,tmp.source);
|
add_string_to_string(res, &tmp);
|
||||||
|
|
||||||
done_string(&tmp);
|
done_string(&tmp);
|
||||||
done_string(&tmp2);
|
done_string(&tmp2);
|
||||||
@ -642,8 +642,8 @@ document_replace(JSContext *ctx, unsigned int argc, JS::Value *vp)
|
|||||||
int fd_len=0;
|
int fd_len=0;
|
||||||
unsigned char *nu;
|
unsigned char *nu;
|
||||||
struct cache_entry *cached = doc_view->document->cached;
|
struct cache_entry *cached = doc_view->document->cached;
|
||||||
cached = doc_view->document->cached;
|
|
||||||
struct fragment *f = get_cache_fragment(cached);
|
struct fragment *f = get_cache_fragment(cached);
|
||||||
|
|
||||||
if (f && f->length)
|
if (f && f->length)
|
||||||
{
|
{
|
||||||
fd_len=f->length;
|
fd_len=f->length;
|
||||||
|
Loading…
Reference in New Issue
Block a user