summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTimo Savinen <tjsa@iki.fi>2005-10-28 06:48:19 +0000
committerHadrien Dorio <hadrien.dorio@gmail.com>2017-12-16 00:24:06 +0100
commit9ed0cccb2c28d503169afe15f123007526a50535 (patch)
treecbe5977cb528edbe509c6b59ea477bd0e3ee4f07 /src
parent9794b5c44b97b5dda3064a96ca65376cb2b9ef4c (diff)
downloadbinary-block-editor-9ed0cccb2c28d503169afe15f123007526a50535.tar.gz
binary-block-editor-9ed0cccb2c28d503169afe15f123007526a50535.zip
0.1.6
Diffstat (limited to 'src')
-rw-r--r--src/bbe.h3
-rw-r--r--src/execute.c5
2 files changed, 6 insertions, 2 deletions
diff --git a/src/bbe.h b/src/bbe.h
index ef30f75..cf00c6b 100644
--- a/src/bbe.h
+++ b/src/bbe.h
@@ -20,7 +20,7 @@
*
*/
-/* $Id: bbe.h,v 1.26 2005/10/19 18:39:13 timo Exp $ */
+/* $Id: bbe.h,v 1.27 2005/10/27 16:37:14 timo Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -109,6 +109,7 @@ struct command_list {
unsigned char *s2; // replace for s and dest for y
off_t s2_len;
int rpos; // replace position for s,r and y
+ off_t fpos; // found pos for s-command
FILE *fd; // stream for w command
struct command_list *next;
};
diff --git a/src/execute.c b/src/execute.c
index 7980221..008cad0 100644
--- a/src/execute.c
+++ b/src/execute.c
@@ -20,7 +20,7 @@
*
*/
-/* $Id: execute.c,v 1.31 2005/10/21 07:53:26 timo Exp $ */
+/* $Id: execute.c,v 1.32 2005/10/27 16:37:14 timo Exp $ */
#include "bbe.h"
#include <stdlib.h>
@@ -204,6 +204,7 @@ execute_commands(struct command_list *c)
break;
}
if(delete_this_byte) break;
+ if(c->fpos == in_buffer.block_offset) break;
p = out_buffer.write_pos;
i = 0;
while(*p == c->s1[i] && i < c->s1_len)
@@ -215,6 +216,7 @@ execute_commands(struct command_list *c)
}
if(i == c->s1_len)
{
+ c->fpos = in_buffer.block_offset;
if(c->s1_len > 1 || c->s2_len > 1) c->rpos = 1;
if(c->s2_len)
{
@@ -562,6 +564,7 @@ reset_rpos(struct command_list *c)
while(c != NULL)
{
c->rpos = 0;
+ c->fpos = -1;
c = c->next;
}
}
OpenPOWER on IntegriCloud