mirror of
https://github.com/radareorg/radare2.git
synced 2024-12-03 19:01:31 +00:00
* Fix fs prompt:
- Added Unknown command - Chop root path
This commit is contained in:
parent
4cb8868ecc
commit
4b86cadf91
@ -225,6 +225,7 @@ R_API int r_fs_prompt (RFS *fs, char *root) {
|
|||||||
RListIter *iter;
|
RListIter *iter;
|
||||||
RFSFile *file;
|
RFSFile *file;
|
||||||
|
|
||||||
|
r_str_chop_path (root);
|
||||||
strncpy (path, root, sizeof (path)-1);
|
strncpy (path, root, sizeof (path)-1);
|
||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
@ -252,6 +253,8 @@ R_API int r_fs_prompt (RFS *fs, char *root) {
|
|||||||
strcat (path, "/");
|
strcat (path, "/");
|
||||||
strcat (path, input);
|
strcat (path, input);
|
||||||
r_str_chop_path (path);
|
r_str_chop_path (path);
|
||||||
|
if (strlen (path) < strlen (root))
|
||||||
|
strncpy (path, root, sizeof (path)-1);
|
||||||
list = r_fs_dir (fs, path);
|
list = r_fs_dir (fs, path);
|
||||||
if (!r_list_empty (list))
|
if (!r_list_empty (list))
|
||||||
r_list_free (list);
|
r_list_free (list);
|
||||||
@ -300,6 +303,8 @@ R_API int r_fs_prompt (RFS *fs, char *root) {
|
|||||||
" q/exit ; leave prompt mode\n"
|
" q/exit ; leave prompt mode\n"
|
||||||
" ?/help ; show this help\n"
|
" ?/help ; show this help\n"
|
||||||
);
|
);
|
||||||
|
} else {
|
||||||
|
printf ("Unknown command %s\n", buf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
clearerr (stdin);
|
clearerr (stdin);
|
||||||
|
Loading…
Reference in New Issue
Block a user