Rev 5210 | Rev 7805 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1665 | Nasarus | 1 | |
5210 | serge | 2 | |
1665 | Nasarus | 3 | |
4 | char temp[256]; |
||
5 | |||
6 | |||
7 | if (NULL == dir) |
||
8 | |||
9 | #if LANG_ENG |
||
10 | printf(" cd |
||
1668 | Nasarus | 11 | #elif LANG_RUS |
12 | printf(" cd <директория>\n\r"); |
||
13 | #endif |
||
4015 | Albom | 14 | return TRUE; |
1668 | Nasarus | 15 | } |
3247 | Albom | 16 | |
1665 | Nasarus | 17 | if ( 0 == strcmp(dir, ".") ) |
18 | |||
19 | |||
20 | if ( ( 0 == strcmp(dir, "..") ) && ( 0 != strcmp(cur_dir, "/")) ) |
||
21 | |||
5210 | serge | 22 | cur_dir[strlen(cur_dir)-1]='\0'; |
1665 | Nasarus | 23 | dir_truncate(cur_dir); |
24 | set_cwd(cur_dir); |
||
25 | return TRUE; |
||
5210 | serge | 26 | } |
4106 | Albom | 27 | |
1665 | Nasarus | 28 | if ( '/' == dir[0]) |
29 | |||
30 | if ( dir_check(dir) ) |
||
31 | { |
||
32 | strcpy(cur_dir, dir); |
||
33 | set_cwd(cur_dir); |
||
34 | return TRUE; |
||
5210 | serge | 35 | } |
1665 | Nasarus | 36 | return FALSE; |
37 | } |
||
38 | else |
||
39 | { |
||
40 | strcpy(temp, cur_dir); |
||
41 | if (cur_dir[strlen(cur_dir)-1] != '/') |
||
42 | strcat(temp, "/"); |
||
5210 | serge | 43 | strcat(temp, dir); |
2323 | Albom | 44 | |
1665 | Nasarus | 45 | if ( dir_check(temp) ) |
46 | |||
47 | |||
48 | strcpy(cur_dir, temp); |
||
2323 | Albom | 49 | |
1665 | Nasarus | 50 | return TRUE; |
5210 | serge | 51 | } |
1665 | Nasarus | 52 | |
53 | return FALSE; |
||
54 | |||
55 | |||
56 | }директория> |
||
57 |