Changeset - r1819:df0415b2be7d
[Not reviewed]
master
0 2 0
tron - 19 years ago 2005-05-15 18:43:36
tron@openttd.org
(svn r2323) Remove unused dereferencing
2 files changed with 6 insertions and 6 deletions:
0 comments (0 inline, 0 general)
console.c
Show inline comments
 
@@ -598,26 +598,26 @@ void IConsoleAliasExec(const IConsoleAli
 
	uint a_index, astream_i;
 

	
 
	memset(&aliases, 0, sizeof(aliases));
 
	memset(&aliasstream, 0, sizeof(aliasstream));
 

	
 
	aliases[0] = aliasstream;
 
	for (cmdptr = alias->cmdline, a_index = 0, astream_i = 0; *cmdptr != '\0'; *cmdptr++) {
 
	for (cmdptr = alias->cmdline, a_index = 0, astream_i = 0; *cmdptr != '\0'; cmdptr++) {
 
		if (a_index >= lengthof(aliases) || astream_i >= lengthof(aliasstream)) break;
 

	
 
		switch (*cmdptr) {
 
		case '\'': /* ' will double for "" */
 
			aliasstream[astream_i++] = '"';
 
			break;
 
		case ';': /* Cmd seperator, start new command */
 
			aliasstream[astream_i] = '\0';
 
			aliases[++a_index] = &aliasstream[++astream_i];
 
			*cmdptr++;
 
			cmdptr++;
 
			break;
 
		case '%': /* Some or all parameters */
 
			*cmdptr++;
 
			cmdptr++;
 
			switch (*cmdptr) {
 
			case '+': { /* All parameters seperated: "[param 1]" "[param 2]" */
 
				for (i = 0; i != tokencount; i++) {
 
					aliasstream[astream_i++] = '"';
 
					astream_i += IConsoleCopyInParams(&aliasstream[astream_i], tokens[i], astream_i);
 
					aliasstream[astream_i++] = '"';
 
@@ -1019,13 +1019,13 @@ void IConsoleCmdExec(const char *cmdstr)
 
	char *tokens[ICON_TOKEN_COUNT], tokenstream[ICON_MAX_STREAMSIZE];
 
	uint t_index, tstream_i;
 

	
 
	bool longtoken = false;
 
	bool foundtoken = false;
 

	
 
	for (cmdptr = cmdstr; *cmdptr != '\0'; *cmdptr++) {
 
	for (cmdptr = cmdstr; *cmdptr != '\0'; cmdptr++) {
 
		if (!IsValidAsciiChar(*cmdptr)) {
 
			IConsoleError("command contains malformed characters, aborting");
 
			IConsolePrintF(_icolour_err, "ERROR: command was: '%s'", cmdstr);
 
			return;
 
		}
 
	}
 
@@ -1037,13 +1037,13 @@ void IConsoleCmdExec(const char *cmdstr)
 
	memset(&tokenstream, 0, sizeof(tokenstream));
 

	
 
	/* 1. Split up commandline into tokens, seperated by spaces, commands
 
	 * enclosed in "" are taken as one token. We can only go as far as the amount
 
	 * of characters in our stream or the max amount of tokens we can handle */
 
	tokens[0] = tokenstream;
 
	for (cmdptr = cmdstr, t_index = 0, tstream_i = 0; *cmdptr != '\0'; *cmdptr++) {
 
	for (cmdptr = cmdstr, t_index = 0, tstream_i = 0; *cmdptr != '\0'; cmdptr++) {
 
		if (t_index >= lengthof(tokens) || tstream_i >= lengthof(tokenstream)) break;
 

	
 
		switch (*cmdptr) {
 
		case ' ': /* Token seperator */
 
			if (!foundtoken) break;
 

	
console_cmds.c
Show inline comments
 
@@ -624,13 +624,13 @@ DEF_CONSOLE_CMD(ConExec)
 
	}
 

	
 
	_script_running = true;
 

	
 
	while (_script_running && fgets(cmdline, sizeof(cmdline), _script_file) != NULL) {
 
		/* Remove newline characters from the executing script */
 
		for (cmdptr = cmdline; *cmdptr != '\0'; *cmdptr++) {
 
		for (cmdptr = cmdline; *cmdptr != '\0'; cmdptr++) {
 
			if (*cmdptr == '\n' || *cmdptr == '\r') {
 
				*cmdptr = '\0';
 
				break;
 
			}
 
		}
 
		IConsoleCmdExec(cmdline);
0 comments (0 inline, 0 general)