diff --git a/common/cmd.c b/common/cmd.c index 5b4e180..1adc112 100644 --- a/common/cmd.c +++ b/common/cmd.c @@ -153,10 +153,11 @@ Cbuf_Execute */ void Cbuf_Execute (void) { - int i; + int i, li; char *text; - char line[1024]; - int quotes; + char line[1024] = {0}; + int quotes; + qboolean escape; while (cmd_text.cursize) { @@ -164,19 +165,31 @@ void Cbuf_Execute (void) text = (char *)cmd_text.data; quotes = 0; + escape = false; + li = 0; for (i=0 ; i< cmd_text.cursize ; i++) { - if (text[i] == '"') + if (escape) { + escape = false; + line[li] = text[i]; + li++; + } else if (text[i] == '\\') { + escape = true; + } else if (text[i] == '"') { quotes++; - if ( !(quotes&1) && text[i] == ';') + line[li] = text[li]; + li++; + } else if ( !(quotes&1) && text[i] == ';') break; // don't break if inside a quoted string - if (text[i] == '\n') + else if (text[i] == '\n' || text[i] == '\r') break; + else { + line[i] = text[i]; + li++; + } } - - memcpy (line, text, i); - line[i] = 0; + line[li] = '\0'; // delete the text from the command buffer and move remaining commands down // this is necessary because commands (exec, alias) can insert data at the diff --git a/common/gl_rpart.c b/common/gl_rpart.c index 00db5f2..f0d7b1a 100644 --- a/common/gl_rpart.c +++ b/common/gl_rpart.c @@ -187,17 +187,12 @@ void R_DrawParticles (void) p->vel[i] -= p->vel[i]*dvel; p->vel[2] -= grav; break; -#ifdef UQUAKE case pt_grav: #ifdef QUAKE2 p->vel[2] -= grav * 20; break; -#endif #endif case pt_slowgrav: -#ifdef QUAKEWORLD - case pt_grav: -#endif p->vel[2] -= grav; break; } diff --git a/common/in_x11.c b/common/in_x11.c index 462ea84..93bee14 100644 --- a/common/in_x11.c +++ b/common/in_x11.c @@ -232,6 +232,8 @@ static void event_button(XEvent *event) case 1: case 2: case 3: + case 4: + case 5: Key_Event(K_MOUSE1 + but - 1, event->type == ButtonPress); } }