diff options
| author | Miguel <m.i@gmx.at> | 2018-10-14 22:36:16 +0200 |
|---|---|---|
| committer | Miguel <m.i@gmx.at> | 2018-10-14 22:36:16 +0200 |
| commit | 2a6690e9fd53a02613796764248006e06ac482d6 (patch) | |
| tree | ea3063ef3ecd0808e9291faf6c56949d91b1b09e /fs | |
| parent | 5aeab1c853e487aa0042d5c32200d623efe908d3 (diff) | |
ported vim et al
Diffstat (limited to 'fs')
| -rw-r--r-- | fs/ext2.c | 2 | ||||
| -rw-r--r-- | fs/mount.c | 18 |
2 files changed, 17 insertions, 3 deletions
@@ -238,7 +238,7 @@ static uint32_t ext2_filename_to_inode_traverse(uint32_t ext2_start_addr, char * } } - klog("file not found!"); + klog("file not found! : %s",path); return 0; } @@ -6,6 +6,7 @@ #include "log.h" #include "lib/string/string.h" +#include "lib/printf/printf.h" #include "fd.h" @@ -58,12 +59,15 @@ static uint32_t check_match(char *p1, char *p2) */ static char* get_mount_for_path(char *path,mount *mnt) { - if(path[0]!='/')kpanic("this works only for absolute paths!"); // start with root as default uint32_t best=0; uint32_t best_len=1; + if(path[0]!='/'){ + kpanic("this works only for absolute paths! supplied: %s",path); + } + for(int i=0;i<mounts_count;i++) { mount *m=&mounts[i]; @@ -83,7 +87,17 @@ static char* get_mount_for_path(char *path,mount *mnt) fd mount_file_open(char *path) { mount m; - char *p=get_mount_for_path(path,&m); + char buf[256]; + if(path[0]!='/'){ + // TODO: use environemnet PWD var! + sprintf(buf,"/home/miguel/%s",path); + } + else + { + sprintf(buf,"%s",path); + } + + char *p=get_mount_for_path(buf,&m); return m.mount_file_open(&m,p); } |
