changeset 73541:964e568f1d1d

(WinMain): Process all recognized arguments, not just the first one. Remove unused variable sec_desc.
author Juanma Barranquero <lekktu@gmail.com>
date Sun, 29 Oct 2006 22:43:37 +0000
parents e6d2c7dae5c8
children 5740f58a5aa8
files nt/runemacs.c
diffstat 1 files changed, 14 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/nt/runemacs.c	Sun Oct 29 22:09:26 2006 +0000
+++ b/nt/runemacs.c	Sun Oct 29 22:43:37 2006 +0000
@@ -33,7 +33,7 @@
    is running emacs.exe already, you cannot install a newer version.
    By defining CHOOSE_NEWEST_EXE, you can name your new emacs.exe
    something else which matches "emacs*.exe", and runemacs will
-   automatically select the newest emacs executeable in the bin directory.
+   automatically select the newest emacs executable in the bin directory.
    (So you'll probably be able to delete the old version some hours/days
    later).
 */
@@ -49,7 +49,6 @@
 {
   STARTUPINFO start;
   SECURITY_ATTRIBUTES sec_attrs;
-  SECURITY_DESCRIPTOR sec_desc;
   PROCESS_INFORMATION child;
   int wait_for_child = FALSE;
   DWORD priority_class = NORMAL_PRIORITY_CLASS;
@@ -85,13 +84,13 @@
       goto error;
     do
       {
-        if (wfd.ftLastWriteTime.dwHighDateTime > best_time.dwHighDateTime
-            || (wfd.ftLastWriteTime.dwHighDateTime == best_time.dwHighDateTime
-                && wfd.ftLastWriteTime.dwLowDateTime > best_time.dwLowDateTime))
-          {
-            best_time = wfd.ftLastWriteTime;
-            strcpy (best_name, wfd.cFileName);
-          }
+	if (wfd.ftLastWriteTime.dwHighDateTime > best_time.dwHighDateTime
+	    || (wfd.ftLastWriteTime.dwHighDateTime == best_time.dwHighDateTime
+		&& wfd.ftLastWriteTime.dwLowDateTime > best_time.dwLowDateTime))
+	  {
+	    best_time = wfd.ftLastWriteTime;
+	    strcpy (best_name, wfd.cFileName);
+	  }
       }
     while (FindNextFile (fh, &wfd));
     FindClose (fh);
@@ -109,9 +108,9 @@
     {
       if (strncmp (cmdline+1, "wait", 4) == 0)
 	{
-      wait_for_child = TRUE;
-      cmdline += 5;
-    }
+	  wait_for_child = TRUE;
+	  cmdline += 5;
+	}
       else if (strncmp (cmdline+1, "high", 4) == 0)
 	{
 	  priority_class = HIGH_PRIORITY_CLASS;
@@ -124,7 +123,10 @@
 	}
       else
 	break;
+      /* Look for next argument.  */
+      while (*++cmdline == ' ');
     }
+
   strcat (new_cmdline, cmdline);
 
   /* Set emacs_dir variable if runemacs was in "%emacs_dir%\bin".  */