Subversion Repositories Kolibri OS

Rev

Rev 2615 | Rev 3247 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2615 Rev 2617
Line 3... Line 3...
3
int executable_run(char cmd[], char args[])
3
int executable_run(char cmd[], char args[])
4
{
4
{
Line 5... Line 5...
5
 
5
 
6
char		exec[256];
-
 
7
#if LANG_ENG
-
 
8
	char		error_starting[]={"  No such command '%s'.\n\r"};
-
 
9
#elif LANG_RUS
-
 
10
	char		error_starting[]={"  ¥â â ª®© ª®¬ ­¤ë - '%s'.\n\r"};
-
 
11
#endif
6
char	exec[256];
Line 12... Line 7...
12
int		result;
7
int		result;
13
 
8
 
14
if ( '/' == cmd[0]) // ¥á«¨ ¯ãâì  ¡á®«îâ­ë©
9
if ( '/' == cmd[0]) // ¥á«¨ ¯ãâì  ¡á®«îâ­ë©
Line 15... Line 10...
15
	{
10
	{
16
	strcpy(exec, cmd);
11
	strcpy(exec, cmd);
17
 
12
 
18
	if (  !file_check(exec) ) // ¯à®¢¥à塞 áãé¥á⢮¢ ­¨¥ ä ©« 
13
	if (  !file_check(exec) ) // ¯à®¢¥à塞 áãé¥á⢮¢ ­¨¥ ä ©« 
19
		{
14
		{
20
		printf(error_starting, cmd);
15
		file_not_found(cmd);
Line 21... Line 16...
21
		return FALSE;
16
		return FALSE;
Line 28... Line 23...
28
	if (exec[strlen(exec)-1] != '/') 
23
	if (exec[strlen(exec)-1] != '/') 
29
		strcat(exec, "/"); // add slash
24
		strcat(exec, "/"); // add slash
30
	strcat(exec, cmd);
25
	strcat(exec, cmd);
31
	
26
	
Line 32... Line -...
32
	printf("\n%s\n", exec);
-
 
33
	
-
 
34
	if ( !file_check(exec) ) // ¯à®¢¥à塞 áãé¥á⢮¢ ­¨¥ ä ©« 
27
	if ( !file_check(exec) ) // ¯à®¢¥à塞 áãé¥á⢮¢ ­¨¥ ä ©« 
35
		{
28
		{
36
		strcpy(exec, "/rd/1/"); // ¯à®¢¥à塞 ä ©« ­  ¢¨àâã «ì­®¬ ¤¨áª¥
29
		strcpy(exec, "/rd/1/"); // ¯à®¢¥à塞 ä ©« ­  ¢¨àâã «ì­®¬ ¤¨áª¥
37
		strcat(exec, cmd);
30
		strcat(exec, cmd);
38
			if ( !file_check(exec) ) // ¯à®¢¥à塞 áãé¥á⢮¢ ­¨¥ ä ©« 
31
			if ( !file_check(exec) ) // ¯à®¢¥à塞 áãé¥á⢮¢ ­¨¥ ä ©« 
39
				{
32
				{
40
				printf(error_starting, cmd);
33
				file_not_found(cmd);
41
				return FALSE;
34
				return FALSE;
42
				}
35
				}
43
		}
36
		}
44
	}
37
	}
Line 63... Line 56...
63
	return TRUE;
56
	return TRUE;
64
	}
57
	}
65
else	
58
else	
66
	{
59
	{
67
	printf(error_starting, cmd);
60
	file_not_found(cmd);
68
	return FALSE;
61
	return FALSE;
69
	}
62
	}
70
 
63
 
Line 71... Line 64...
71
}
64
}