]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - sys_win.c
made dedicated servers hog a whole lot less CPU time
[xonotic/darkplaces.git] / sys_win.c
index a2be13cc89920c0e9a884ef6545d1d0972e30622..e261d04ddf5d046c9db2af7cb07eb8b02401e274 100644 (file)
--- a/sys_win.c
+++ b/sys_win.c
@@ -356,31 +356,31 @@ int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLin
                while (*lpCmdLine && *lpCmdLine <= ' ')
                        lpCmdLine++;
 
-               if (*lpCmdLine)
+               if (!*lpCmdLine)
+                       break;
+
+               if (*lpCmdLine == '\"')
                {
-                       if (*lpCmdLine == '\"')
-                       {
-                               // quoted string
+                       // quoted string
+                       lpCmdLine++;
+                       argv[com_argc] = lpCmdLine;
+                       com_argc++;
+                       while (*lpCmdLine && (*lpCmdLine != '\"'))
                                lpCmdLine++;
-                               argv[com_argc] = lpCmdLine;
-                               com_argc++;
-                               while (*lpCmdLine && (*lpCmdLine != '\"'))
-                                       lpCmdLine++;
-                       }
-                       else
-                       {
-                               // unquoted word
-                               argv[com_argc] = lpCmdLine;
-                               com_argc++;
-                               while (*lpCmdLine && *lpCmdLine > ' )
-                                       lpCmdLine++;
-                       }
-
-                       if (*lpCmdLine)
-                       {
-                               *lpCmdLine = 0;
+               }
+               else
+               {
+                       // unquoted word
+                       argv[com_argc] = lpCmdLine;
+                       com_argc++;
+                       while (*lpCmdLine && *lpCmdLine > ' ')
                                lpCmdLine++;
-                       }
+               }
+
+               if (*lpCmdLine)
+               {
+                       *lpCmdLine = 0;
+                       lpCmdLine++;
                }
        }