summaryrefslogtreecommitdiffstats
path: root/src/dir.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2008-08-24 13:36:34 +0200
committerChristophe Grenier <grenier@cgsecurity.org>2008-08-24 13:36:34 +0200
commit9a58a494f354766e1bda5ca0f72e0af60f5124de (patch)
treebfabf63ee6684f79b6f724f2cda5de8b5fadbc76 /src/dir.c
parent05241d82968e9ee7195a424091e733b43d776945 (diff)
Split the interface in several files
Initial work to handle 24 lines and more than 25
Diffstat (limited to 'src/dir.c')
-rw-r--r--src/dir.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/dir.c b/src/dir.c
index ae93973..00f5911 100644
--- a/src/dir.c
+++ b/src/dir.c
@@ -413,8 +413,6 @@ static long int dir_aff_ncurses(disk_t *disk_car, const partition_t *partition,
pos=pos->prev;
pos_num--;
}
- if(pos_num<offset)
- offset--;
break;
case KEY_DOWN:
case '2':
@@ -423,8 +421,6 @@ static long int dir_aff_ncurses(disk_t *disk_car, const partition_t *partition,
pos=pos->next;
pos_num++;
}
- if(pos_num>=offset+INTER_DIR)
- offset++;
break;
case 'p':
case 'P':
@@ -460,8 +456,6 @@ static long int dir_aff_ncurses(disk_t *disk_car, const partition_t *partition,
{
pos=pos->prev;
pos_num--;
- if(pos_num<offset)
- offset--;
}
break;
case KEY_NPAGE:
@@ -469,8 +463,6 @@ static long int dir_aff_ncurses(disk_t *disk_car, const partition_t *partition,
{
pos=pos->next;
pos_num++;
- if(pos_num>=offset+INTER_DIR)
- offset++;
}
break;
case 'c':
@@ -538,6 +530,10 @@ static long int dir_aff_ncurses(disk_t *disk_car, const partition_t *partition,
}
break;
}
+ if(pos_num<offset)
+ offset=pos_num;
+ if(pos_num>=offset+INTER_DIR)
+ offset=pos_num-INTER_DIR+1;
}
} while(quit==0 && old_LINES==LINES);
} while(quit==0);