summaryrefslogtreecommitdiff
path: root/src/mark.c
diff options
context:
space:
mode:
authorSadrul Habib Chowdhury <sadrul@users.sourceforge.net>2008-08-07 22:25:49 -0400
committerSadrul Habib Chowdhury <sadrul@users.sourceforge.net>2008-08-07 22:25:49 -0400
commit4e406611290b83b39c7a43b260abb1068aa589c5 (patch)
tree85f7db835d974142d79ebb01ce334d59fdf5c84e /src/mark.c
parentbe4930f1de6b7f8615358ee9ab9e6b6438fbc660 (diff)
downloadscreen-4e406611290b83b39c7a43b260abb1068aa589c5.tar.gz
Prevent crashing from ;, in copy mode without fFtT
Make sure there is some search to repeat when ;, is pressed in copy mode.
Diffstat (limited to 'src/mark.c')
-rw-r--r--src/mark.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/mark.c b/src/mark.c
index 08f49b8..54c39f4 100644
--- a/src/mark.c
+++ b/src/mark.c
@@ -170,7 +170,7 @@ nextchar(int *xp, int *yp, int direction, char target, int num)
debug1("ml->image = %s\n", displayed_line);
debug2("num = %d, width = %d\n",num, width);
- debug2("x = %d targe = %c\n", x, target );
+ debug2("x = %d target = %c\n", x, target );
for ( ;x>=0 && x <= width; x += step) {
if (displayed_line[x] == target) {
@@ -618,6 +618,8 @@ int *inlenp;
debug("entering char search\n");
continue;
case ';':
+ if (!markdata->f_cmd.target)
+ break;
if (!rep_cnt)
rep_cnt = 1;
nextchar(&cx, &cy, markdata->f_cmd.direction, markdata->f_cmd.target, rep_cnt );
@@ -625,6 +627,8 @@ int *inlenp;
break;
case ',': {
int search_dir;
+ if (!markdata->f_cmd.target)
+ break;
if (!rep_cnt)
rep_cnt = 1;
switch (markdata->f_cmd.direction) {
@@ -634,7 +638,6 @@ int *inlenp;
case 'F': search_dir = 'f'; break;
}
nextchar(&cx, &cy, search_dir, markdata->f_cmd.target, rep_cnt );
-
revto(cx, cy);
break;
}