summaryrefslogtreecommitdiffstats
path: root/src/fat_adv.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/fat_adv.c
parent05241d82968e9ee7195a424091e733b43d776945 (diff)
Split the interface in several files
Initial work to handle 24 lines and more than 25
Diffstat (limited to 'src/fat_adv.c')
-rw-r--r--src/fat_adv.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/fat_adv.c b/src/fat_adv.c
index 2b22732..6135fea 100644
--- a/src/fat_adv.c
+++ b/src/fat_adv.c
@@ -274,8 +274,6 @@ static int ask_root_directory(disk_t *disk_car, const partition_t *partition, co
pos=pos->prev;
pos_num--;
}
- if(pos_num<offset)
- offset--;
break;
case KEY_DOWN:
if(pos->next!=NULL)
@@ -283,28 +281,26 @@ static int ask_root_directory(disk_t *disk_car, const partition_t *partition, co
pos=pos->next;
pos_num++;
}
- if(pos_num>=offset+INTER_DIR)
- offset++;
break;
case KEY_PPAGE:
- for(i=0;(i<INTER_DIR-1)&&(pos->prev!=NULL);i++)
+ for(i=0; i<INTER_DIR-1 && pos->prev!=NULL; i++)
{
pos=pos->prev;
pos_num--;
- if(pos_num<offset)
- offset--;
}
break;
case KEY_NPAGE:
- for(i=0;(i<INTER_DIR-1)&&(pos->next!=NULL);i++)
+ for(i=0; i<INTER_DIR-1 && pos->next!=NULL; i++)
{
pos=pos->next;
pos_num++;
- if(pos_num>=offset+INTER_DIR)
- offset++;
}
break;
}
+ if(pos_num<offset)
+ offset=pos_num;
+ if(pos_num>=offset+INTER_DIR)
+ offset=pos_num-INTER_DIR+1;
}
} while(quit==0);
curs_set(0);