fixed bug with cd ../

fixed cd . and cd ./ behavior

git-svn-id: svn://kolibrios.org@7805 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Rustem Gimadutdinov (rgimad) 2020-04-17 21:43:55 +00:00
parent 667c49c5af
commit 610a0f5c6e
2 changed files with 4 additions and 4 deletions

View File

@ -16,10 +16,10 @@ if (NULL == dir)
return TRUE; return TRUE;
} }
if ( 0 == strcmp(dir, ".") ) if ( 0 == strcmp(dir, ".") || 0 == strcmp(dir, "./") )
return FALSE; return TRUE;
if ( ( 0 == strcmp(dir, "..") ) && ( 0 != strcmp(cur_dir, "/")) ) if ( ( 0 == strcmp(dir, "..") || 0 == strcmp(dir, "../") ) && ( 0 != strcmp(cur_dir, "/")) )
{ {
cur_dir[strlen(cur_dir)-1]='\0'; cur_dir[strlen(cur_dir)-1]='\0';
dir_truncate(cur_dir); dir_truncate(cur_dir);

View File

@ -1,5 +1,5 @@
#define SHELL_VERSION "0.8" #define SHELL_VERSION "0.8a"
extern char PATH[256]; extern char PATH[256];
extern char PARAM[256]; extern char PARAM[256];