[ros-diffs] [cfinck] 30653: Use _stricmp instead of _strnicmp to ensure that the function jumps into the shortcut handling block, when the user entered a shortcut name as the parameter.

cfinck at svn.reactos.org cfinck at svn.reactos.org
Wed Nov 21 22:28:46 CET 2007


Author: cfinck
Date: Thu Nov 22 00:28:46 2007
New Revision: 30653

URL: http://svn.reactos.org/svn/reactos?rev=30653&view=rev
Log:
Use _stricmp instead of _strnicmp to ensure that the function jumps into the shortcut handling block, when the user entered a shortcut name as the parameter.

Modified:
    trunk/tools/RosBE/RosBE-Windows/Tools/scut.c

Modified: trunk/tools/RosBE/RosBE-Windows/Tools/scut.c
URL: http://svn.reactos.org/svn/reactos/trunk/tools/RosBE/RosBE-Windows/Tools/scut.c?rev=30653&r1=30652&r2=30653&view=diff
==============================================================================
--- trunk/tools/RosBE/RosBE-Windows/Tools/scut.c (original)
+++ trunk/tools/RosBE/RosBE-Windows/Tools/scut.c Thu Nov 22 00:28:46 2007
@@ -8,7 +8,7 @@
  *
  */
 
-#include <unistd.h>
+//#include <unistd.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -59,9 +59,9 @@
     {
         defaultshortcut(NULL);
     }
-    else if ((!strncmp(argv[1], "/?", 2)) ||
-             (!_strnicmp(argv[1], "-h", 2)) ||
-             (!_strnicmp(argv[1], "--help", 6)))
+    else if ((!strcmp(argv[1], "/?")) ||
+             (!_stricmp(argv[1], "-h")) ||
+             (!_stricmp(argv[1], "--help")))
     {
         printf("Usage: %s [OPTIONS] [SHORTCUT] [PATH]\n", programname);
         printf("Manages named shortcuts to ReactOS source directories. scut started\n");
@@ -79,7 +79,7 @@
         printf("             directory as you know it from previous versions.\n\n");
         return 0;
     }
-    else if (!_strnicmp(argv[1], "list", 4))
+    else if (!_stricmp(argv[1], "list"))
     {
         shortcuts = readshortcuts();
         current = shortcuts;
@@ -93,7 +93,7 @@
         }
         freeshortcuts(shortcuts);
     }
-    else if (!_strnicmp(argv[1], "add", 3))
+    else if (!_stricmp(argv[1], "add"))
     {
         shortcuts = readshortcuts();
         current = shortcuts;
@@ -144,7 +144,7 @@
         }
         freeshortcuts(shortcuts);
     }
-    else if (!_strnicmp(argv[1], "rem", 3))
+    else if (!_stricmp(argv[1], "rem"))
     {
         shortcuts = readshortcuts();
         current = shortcuts;
@@ -191,7 +191,7 @@
         }
         freeshortcuts(shortcuts);
     }
-    else if (!_strnicmp(argv[1], "edit", 4))
+    else if (!_stricmp(argv[1], "edit"))
     {
         shortcuts = readshortcuts();
         current = shortcuts;
@@ -252,7 +252,7 @@
         }
         freeshortcuts(shortcuts);
     }
-    else if (!_strnicmp(argv[1], "def", 3))
+    else if (!_stricmp(argv[1], "def"))
     {
         shortcuts = readshortcuts();
         current = shortcuts;
@@ -336,14 +336,14 @@
     fp = fopen(shortcutfile, "r");
     if (!fp)
     {
-        if(access(rosbeappdata, F_OK) == -1)
+/*        if(access(rosbeappdata, F_OK) == -1)
         {
             // Directory does not exist, create it
             if(mkdir(rosbeappdata) == -1)
             {
                 fprintf(stderr, "%s: Error creating the directory for the RosBE files.\n", programname);
             }
-        }
+        }*/
 
         fp = fopen(shortcutfile, "w");
         if (!fp)




More information about the Ros-diffs mailing list