Author: cfinck Date: Fri Nov 23 20:01:34 2007 New Revision: 30699
URL: http://svn.reactos.org/svn/reactos?rev=30699&view=rev Log: - Fix scut.cmd again. My previous attempt passed all parameters as one parameter to scut.exe, this one should work correct now. - Check if fgets was really successful, if not terminate the program. This prevents bad outputs if the user pressed Control-C at a prompt.
Modified: trunk/tools/RosBE/RosBE-Windows/Root/scut.cmd trunk/tools/RosBE/RosBE-Windows/Tools/scut.c
Modified: trunk/tools/RosBE/RosBE-Windows/Root/scut.cmd URL: http://svn.reactos.org/svn/reactos/trunk/tools/RosBE/RosBE-Windows/Root/scut... ============================================================================== --- trunk/tools/RosBE/RosBE-Windows/Root/scut.cmd (original) +++ trunk/tools/RosBE/RosBE-Windows/Root/scut.cmd Fri Nov 23 20:01:34 2007 @@ -31,7 +31,7 @@ goto :EOC
:paramcall -call "%_ROSBE_BASEDIR%\Tools\scut.exe" "%*" +call "%_ROSBE_BASEDIR%\Tools\scut.exe" "%1" %2 %3
:EOC title ReactOS Build Environment %_ROSBE_VERSION%
Modified: trunk/tools/RosBE/RosBE-Windows/Tools/scut.c URL: http://svn.reactos.org/svn/reactos/trunk/tools/RosBE/RosBE-Windows/Tools/scu... ============================================================================== --- trunk/tools/RosBE/RosBE-Windows/Tools/scut.c (original) +++ trunk/tools/RosBE/RosBE-Windows/Tools/scut.c Fri Nov 23 20:01:34 2007 @@ -117,8 +117,11 @@ { printf("Please enter a name for the shortcut: "); fflush(stdin); - fgets(name, 260, stdin); - } while(strlen(name) == 1); + + if(!fgets(name, 260, stdin)) + return 1; + } while(strlen(name) <= 1); + strcpy(name, strtok(name, "\n")); } if (!checkname(shortcuts, name)) @@ -137,8 +140,11 @@ { printf("Please enter the path for the shortcut: "); fflush(stdin); - fgets(path, 260, stdin); - } while(strlen(path) == 1); + + if(!fgets(path, 260, stdin)) + return 1; + } while(strlen(path) <= 1); + strcpy(path, strtok(path, "\n")); } if (!checkpath(path)) @@ -168,8 +174,11 @@ { printf("Please enter the name of the shortcut to remove: "); fflush(stdin); - fgets(name, 260, stdin); - } while(strlen(name) == 1); + + if(!fgets(name, 260, stdin)) + return 1; + } while(strlen(name) <= 1); + strcpy(name, strtok(name, "\n")); } if (!_stricmp(name, "Default")) @@ -215,8 +224,11 @@ { printf("Please enter the name of the shortcut to edit: "); fflush(stdin); - fgets(name, 260, stdin); - } while(strlen(name) == 1); + + if(!fgets(name, 260, stdin)) + return 1; + } while(strlen(name) <= 1); + strcpy(name, strtok(name, "\n")); } if (!_stricmp(name, "Default") || checkname(shortcuts, name)) @@ -239,8 +251,11 @@ { printf("Please enter a new path for the shortcut: "); fflush(stdin); - fgets(path, 260, stdin); - } while(strlen(path) == 1); + + if(!fgets(path, 260, stdin)) + return 1; + } while(strlen(path) <= 1); + strcpy(path, strtok(path, "\n")); } if (!checkpath(path)) @@ -276,8 +291,11 @@ { printf("Please enter the the name of the shortcut to set as default: "); fflush(stdin); - fgets(name, 260, stdin); - } while(strlen(name) == 1); + + if(!fgets(name, 260, stdin)) + return 1; + } while(strlen(name) <= 1); + strcpy(name, strtok(name, "\n")); } if (!_stricmp(name, "Default") || checkname(shortcuts, name))