Now for incorrect scripts (which doesnt start with #SHS) shell says that they are incorrect, not "File not found". Also, translated comments from russian to english in two files.
git-svn-id: svn://kolibrios.org@7792 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
@@ -4,63 +4,68 @@
|
||||
int executable_run(char cmd[], char args[])
|
||||
{
|
||||
|
||||
char exec[FILENAME_MAX];
|
||||
int result;
|
||||
char exec[FILENAME_MAX];
|
||||
int result;
|
||||
|
||||
if ( '/' == cmd[0]) // <EFBFBD> <20><><EFBFBD><EFBFBD> <20><>᮫<EFBFBD><E1AEAB><EFBFBD><EFBFBD><EFBFBD>
|
||||
if ( '/' == cmd[0]) // if path is absolute
|
||||
{
|
||||
strcpy(exec, cmd);
|
||||
|
||||
if ( !file_check(exec) ) // <20><EFBFBD><E0AEA2>塞 <20><><EFBFBD><EFBFBD><EFBFBD>⢮<EFBFBD><E2A2AE><EFBFBD><EFBFBD><EFBFBD> 䠩<><E4A0A9>
|
||||
strcpy(exec, cmd);
|
||||
if (!file_check(exec) ) // check file existense
|
||||
{
|
||||
file_not_found(cmd);
|
||||
return FALSE;
|
||||
file_not_found(cmd);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
else
|
||||
else
|
||||
{
|
||||
strcpy(exec, cur_dir); // <EFBFBD><EFBFBD><EFBFBD>塞 䠩<> <20> ⥪<>饬 <20><>⠫<EFBFBD><E2A0AB><EFBFBD>
|
||||
if (exec[strlen(exec)-1] != '/')
|
||||
strcat(exec, "/"); // add slash
|
||||
strcat(exec, cmd);
|
||||
|
||||
if ( !file_check(exec) ) // <20><EFBFBD><E0AEA2>塞 <20><><EFBFBD><EFBFBD><EFBFBD>⢮<EFBFBD><E2A2AE><EFBFBD><EFBFBD><EFBFBD> 䠩<><E4A0A9>
|
||||
{
|
||||
strcpy(exec, "/rd/1/"); // <20><EFBFBD><E0AEA2>塞 䠩<> <20><> <20><><EFBFBD><EFBFBD>㠫쭮<E3A0AB> <20><>᪥
|
||||
strcpy(exec, cur_dir); // check file in current directory
|
||||
if (exec[strlen(exec)-1] != '/')
|
||||
strcat(exec, "/"); // add slash
|
||||
strcat(exec, cmd);
|
||||
if ( !file_check(exec) ) // <20><EFBFBD><E0AEA2>塞 <20><><EFBFBD><EFBFBD><EFBFBD>⢮<EFBFBD><E2A2AE><EFBFBD><EFBFBD><EFBFBD> 䠩<><E4A0A9>
|
||||
{
|
||||
|
||||
if ( !file_check(exec) ) // check file existense
|
||||
{
|
||||
strcpy(exec, "/rd/1/"); // check file on virtual disk
|
||||
strcat(exec, cmd);
|
||||
if ( !file_check(exec) ) // check file existense
|
||||
{
|
||||
file_not_found(cmd);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// if file exists:
|
||||
|
||||
if ( script_check(exec) )
|
||||
return script_run(exec, args);
|
||||
|
||||
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ணࠬ<E0AEA3><E0A0AC> */
|
||||
result = program_run(exec, args);
|
||||
if (result > 0)
|
||||
// try to run as a program
|
||||
result = program_run(exec, args);
|
||||
if (result > 0)
|
||||
{
|
||||
|
||||
if ( !program_console(result) )
|
||||
if ( !program_console(result) )
|
||||
{
|
||||
LAST_PID = result;
|
||||
#if LANG_ENG
|
||||
printf (" '%s' started. PID = %d\n\r", cmd, result);
|
||||
#elif LANG_RUS
|
||||
printf (" '%s' <20><><EFBFBD><EFBFBD>饭. PID = %d\n\r", cmd, result);
|
||||
#endif
|
||||
LAST_PID = result;
|
||||
#if LANG_ENG
|
||||
printf (" '%s' started. PID = %d\n\r", cmd, result);
|
||||
#elif LANG_RUS
|
||||
printf (" '%s' <20><><EFBFBD><EFBFBD>饭. PID = %d\n\r", cmd, result);
|
||||
#endif
|
||||
}
|
||||
return TRUE;
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
file_not_found(cmd);
|
||||
return FALSE;
|
||||
if ( script_check(exec) ) // if file is a valid script
|
||||
{
|
||||
return script_run(exec, args);
|
||||
} else
|
||||
{
|
||||
#if LANG_ENG
|
||||
printf ("Error in '%s' : script must start with #SHS line\n\r", cmd);
|
||||
#elif LANG_RUS
|
||||
printf ("<EFBFBD>訡<EFBFBD><EFBFBD> <20> '%s' : <20><>ਯ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>稭<EFBFBD><E7A8AD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD>窨 #SHS\n\r", cmd);
|
||||
#endif
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user