*Replace every tab with 4 spaces, checked by hand
--HG-- branch : trunk
This commit is contained in:
1 parent
c88304af95
commit
e581351794
10 files changed
+84
-84
No files matched your search
@@ -57,17 +57,17 @@ char * command_finder(const char* text, int state)
|
||||
while(ret = cmd[idx].Name)
|
||||
{
|
||||
if(!cmd[idx].AllowConsole)
|
||||
{
|
||||
idx++;
|
||||
continue;
|
||||
}
|
||||
{
|
||||
idx++;
|
||||
continue;
|
||||
}
|
||||
|
||||
idx++;
|
||||
//printf("Checking %s \n", cmd[idx].Name);
|
||||
if (strncmp(ret, text, len) == 0)
|
||||
return strdup(ret);
|
||||
return strdup(ret);
|
||||
if(cmd[idx].Name == NULL)
|
||||
break;
|
||||
break;
|
||||
}
|
||||
|
||||
return ((char*)NULL);
|
||||
@@ -378,9 +378,9 @@ void CliRunnable::run()
|
||||
bool canflush = true;
|
||||
///- Display the list of available CLI functions then beep
|
||||
sLog.outString("");
|
||||
#if PLATFORM != WINDOWS
|
||||
#if PLATFORM != WINDOWS
|
||||
rl_attempted_completion_function = cli_completion;
|
||||
#endif
|
||||
#endif
|
||||
if(sConfig.GetBoolDefault("BeepAtStart", true))
|
||||
printf("\a"); // \a = Alert
|
||||
|
||||
@@ -395,13 +395,13 @@ void CliRunnable::run()
|
||||
|
||||
char *command_str ; // = fgets(commandbuf,sizeof(commandbuf),stdin);
|
||||
|
||||
#if PLATFORM == WINDOWS
|
||||
command_str = fgets(commandbuf,sizeof(commandbuf),stdin);
|
||||
#else
|
||||
command_str = readline("TC>");
|
||||
rl_bind_key('\t',rl_complete);
|
||||
#endif
|
||||
if (command_str != NULL)
|
||||
#if PLATFORM == WINDOWS
|
||||
command_str = fgets(commandbuf,sizeof(commandbuf),stdin);
|
||||
#else
|
||||
command_str = readline("TC>");
|
||||
rl_bind_key('\t',rl_complete);
|
||||
#endif
|
||||
if (command_str != NULL)
|
||||
{
|
||||
for(int x=0;command_str[x];x++)
|
||||
if(command_str[x]=='\r'||command_str[x]=='\n')
|
||||
@@ -413,27 +413,27 @@ void CliRunnable::run()
|
||||
|
||||
if(!*command_str)
|
||||
{
|
||||
#if PLATFORM == WINDOWS
|
||||
printf("TC>");
|
||||
#endif
|
||||
#if PLATFORM == WINDOWS
|
||||
printf("TC>");
|
||||
#endif
|
||||
continue;
|
||||
}
|
||||
|
||||
std::string command;
|
||||
if(!consoleToUtf8(command_str,command)) // convert from console encoding to utf8
|
||||
{
|
||||
#if PLATFORM == WINDOWS
|
||||
printf("TC>");
|
||||
#endif
|
||||
#if PLATFORM == WINDOWS
|
||||
printf("TC>");
|
||||
#endif
|
||||
continue;
|
||||
}
|
||||
fflush(stdout);
|
||||
fflush(stdout);
|
||||
sWorld.QueueCliCommand(&utf8print,command.c_str());
|
||||
#if PLATFORM != WINDOWS
|
||||
add_history(command.c_str());
|
||||
#endif
|
||||
#if PLATFORM != WINDOWS
|
||||
add_history(command.c_str());
|
||||
#endif
|
||||
|
||||
}
|
||||
}
|
||||
else if (feof(stdin))
|
||||
{
|
||||
World::StopNow(SHUTDOWN_EXIT_CODE);
|
||||
|
||||
Reference in new issue
Block a user