1,28 → 1,20 |
|
int cmd_touch(char file[]) |
{ |
|
kol_struct70 k70; |
char temp[FILENAME_MAX]; |
unsigned result; |
|
if (NULL == file || strlen(file) == 0) |
{ |
#if LANG_ENG |
printf(" touch <filename>\n\r"); |
#elif LANG_RUS |
printf(" touch <¨¬ï ä ©« >\n\r"); |
#endif |
if (NULL == file || strlen(file) == 0) { |
printf(CMD_TOUCH_USAGE); |
return TRUE; |
} |
|
if ( ( 0 == strcmp(file, ".") ) || ( 0 == strcmp(file, "..") ) || ( 0 == strcmp(cur_dir, "/")) ) |
{ |
if ( ( 0 == strcmp(file, ".") ) || ( 0 == strcmp(file, "..") ) || ( 0 == strcmp(cur_dir, "/")) ) { |
return FALSE; |
} |
|
if ( '/' == file[0]) |
{ |
if ( '/' == file[0]) { |
strcpy(temp, file); |
|
if ( !file_check(temp) ) |
29,9 → 21,7 |
k70.p00 = 2; |
else |
k70.p00 = 3; |
} |
else |
{ |
} else { |
strcpy(temp, cur_dir); |
if (temp[strlen(temp)-1] != '/') |
strcat(temp, "/"); // add slash |