From 306b448222cc2435016d40b22a7e6a46e59796d6 Mon Sep 17 00:00:00 2001 From: Albom Date: Sat, 26 Oct 2013 18:53:48 +0000 Subject: [PATCH] Shell 0.7.2. 1) .shell moved to /sys/settings. 2) "cd .." command fixed. git-svn-id: svn://kolibrios.org@4106 a494cfbc-eb01-0410-851d-a64ba20cac60 --- data/eng/Makefile | 2 +- data/et/Makefile | 2 +- data/it/Makefile | 2 +- data/rus/Makefile | 2 +- data/sp/Makefile | 2 +- programs/system/shell/History.txt | 5 +++++ programs/system/shell/cmd/cmd_cd.c | 2 +- programs/system/shell/globals.h | 2 +- programs/system/shell/shell.c | 8 +++++++- 9 files changed, 19 insertions(+), 8 deletions(-) diff --git a/data/eng/Makefile b/data/eng/Makefile index bea9f48d16..9db06c7bbe 100644 --- a/data/eng/Makefile +++ b/data/eng/Makefile @@ -261,7 +261,7 @@ COPY_FILES:=\ games/soko-8.lev:GAMES/SOKO-8.LEV:$(PROGS)/games/soko/trunk/SOKO-8.LEV \ games/soko-9.lev:GAMES/SOKO-9.LEV:$(PROGS)/games/soko/trunk/SOKO-9.LEV \ media/kiv.ini:MEDIA/KIV.INI:$(PROGS)/media/kiv/trunk/kiv.ini \ - .shell:.shell:$(PROGS)/system/shell/bin/eng/.shell \ + settings/.shell:SETTINGS/.shell:$(PROGS)/system/shell/bin/eng/.shell \ settings/mykey.ini:SETTINGS/MYKEY.INI:$(PROGS)/system/MyKey/trunk/mykey.ini \ example.asm:EXAMPLE.ASM:$(PROGS)/develop/examples/example/trunk/example.asm \ # end of list diff --git a/data/et/Makefile b/data/et/Makefile index bea9f48d16..9db06c7bbe 100644 --- a/data/et/Makefile +++ b/data/et/Makefile @@ -261,7 +261,7 @@ COPY_FILES:=\ games/soko-8.lev:GAMES/SOKO-8.LEV:$(PROGS)/games/soko/trunk/SOKO-8.LEV \ games/soko-9.lev:GAMES/SOKO-9.LEV:$(PROGS)/games/soko/trunk/SOKO-9.LEV \ media/kiv.ini:MEDIA/KIV.INI:$(PROGS)/media/kiv/trunk/kiv.ini \ - .shell:.shell:$(PROGS)/system/shell/bin/eng/.shell \ + settings/.shell:SETTINGS/.shell:$(PROGS)/system/shell/bin/eng/.shell \ settings/mykey.ini:SETTINGS/MYKEY.INI:$(PROGS)/system/MyKey/trunk/mykey.ini \ example.asm:EXAMPLE.ASM:$(PROGS)/develop/examples/example/trunk/example.asm \ # end of list diff --git a/data/it/Makefile b/data/it/Makefile index 7d6d576d96..6b67c905db 100644 --- a/data/it/Makefile +++ b/data/it/Makefile @@ -261,7 +261,7 @@ COPY_FILES:=\ games/soko-8.lev:GAMES/SOKO-8.LEV:$(PROGS)/games/soko/trunk/SOKO-8.LEV \ games/soko-9.lev:GAMES/SOKO-9.LEV:$(PROGS)/games/soko/trunk/SOKO-9.LEV \ media/kiv.ini:MEDIA/KIV.INI:$(PROGS)/media/kiv/trunk/kiv.ini \ - .shell:.shell:$(PROGS)/system/shell/bin/eng/.shell \ + settings/.shell:SETTINGS/.shell:$(PROGS)/system/shell/bin/eng/.shell \ settings/mykey.ini:SETTINGS/MYKEY.INI:$(PROGS)/system/MyKey/trunk/mykey_it.ini \ # end of list diff --git a/data/rus/Makefile b/data/rus/Makefile index e78e685fd8..37bf632092 100644 --- a/data/rus/Makefile +++ b/data/rus/Makefile @@ -254,7 +254,7 @@ COPY_FILES:=\ fonts/litt.chr:FONTS/LITT.CHR:$(PROGS)/demos/bgitest/trunk/FONTS/LITT.CHR \ games/snake.ini:GAMES/SNAKE.INI:$(PROGS)/games/snake/trunk/snake.ini \ media/kiv.ini:MEDIA/KIV.INI:$(PROGS)/media/kiv/trunk/kiv.ini \ - .shell:.shell:$(PROGS)/system/shell/bin/rus/.shell \ + settings/.shell:SETTINGS/.shell:$(PROGS)/system/shell/bin/rus/.shell \ settings/mykey.ini:SETTINGS/MYKEY.INI:$(PROGS)/system/MyKey/trunk/mykey.ini \ example.asm:EXAMPLE.ASM:$(PROGS)/develop/examples/example/trunk/rus/example.asm \ # end of list diff --git a/data/sp/Makefile b/data/sp/Makefile index 2296bcb037..9c8a2a9e32 100644 --- a/data/sp/Makefile +++ b/data/sp/Makefile @@ -261,7 +261,7 @@ COPY_FILES:=\ games/soko-8.lev:GAMES/SOKO-8.LEV:$(PROGS)/games/soko/trunk/SOKO-8.LEV \ games/soko-9.lev:GAMES/SOKO-9.LEV:$(PROGS)/games/soko/trunk/SOKO-9.LEV \ media/kiv.ini:MEDIA/KIV.INI:$(PROGS)/media/kiv/trunk/kiv.ini \ - .shell:.shell:$(PROGS)/system/shell/bin/eng/.shell \ + settings/.shell:SETTINGS/.shell:$(PROGS)/system/shell/bin/eng/.shell \ settings/mykey.ini:SETTINGS/MYKEY.INI:$(PROGS)/system/MyKey/trunk/mykey.ini \ # end of list diff --git a/programs/system/shell/History.txt b/programs/system/shell/History.txt index 066a19c6f7..32dac4ae19 100644 --- a/programs/system/shell/History.txt +++ b/programs/system/shell/History.txt @@ -1,3 +1,8 @@ +Shell 0.7.2 // 26.10.2013 // Albom +* Файл .shell перенесен в /sys/settings/ +* Исправлена команда "cd .." + + Shell 0.7.1 // 19.10.2013 // Albom * Исправлена ошибка, связанная с зависанием при попытке чтения пустой истории команд (по клавишам Up и Down) diff --git a/programs/system/shell/cmd/cmd_cd.c b/programs/system/shell/cmd/cmd_cd.c index 2d6f5a05da..8648d2b3aa 100644 --- a/programs/system/shell/cmd/cmd_cd.c +++ b/programs/system/shell/cmd/cmd_cd.c @@ -22,7 +22,7 @@ if ( ( 0 == strcmp(dir, "..") ) && ( 0 != strcmp(cur_dir, "/")) ) { cur_dir[strlen(cur_dir)-1]='\0'; dir_truncate(cur_dir); - return FALSE; + return TRUE; } if ( '/' == dir[0]) diff --git a/programs/system/shell/globals.h b/programs/system/shell/globals.h index b805182e08..e2d17ccc4a 100644 --- a/programs/system/shell/globals.h +++ b/programs/system/shell/globals.h @@ -1,5 +1,5 @@ -#define SHELL_VERSION "0.7.1" +#define SHELL_VERSION "0.7.2" extern char PATH[256]; extern char PARAM[256]; diff --git a/programs/system/shell/shell.c b/programs/system/shell/shell.c index 785e3f7ff5..f4bebbce2b 100644 --- a/programs/system/shell/shell.c +++ b/programs/system/shell/shell.c @@ -128,7 +128,13 @@ con_set_cursor_height(con_get_font_height()-1); ALIASES = malloc(128*1024); -if (PARAM[0] == 0) strcpy(CMD, ".shell"); +if (PARAM[0] == 0) + { + strcpy(CMD, cur_dir); + strcat(CMD, ".shell"); + if ( !file_check(CMD) ) + strcpy(CMD, "/sys/settings/.shell"); + } else { if (PARAM[0] == '/')