Author: peterw
Date: Mon Nov 5 16:04:18 2007
New Revision: 30171
URL:
http://svn.reactos.org/svn/reactos?rev=30171&view=rev
Log:
- Very quickly, make scut.exe create it's file if needed and remoce the srclist.txt
from svn.
Removed:
trunk/tools/RosBE-Windows/Appdata/
Modified:
trunk/tools/RosBE-Windows/Tools/scut.c
Modified: trunk/tools/RosBE-Windows/Tools/scut.c
URL:
http://svn.reactos.org/svn/reactos/trunk/tools/RosBE-Windows/Tools/scut.c?r…
==============================================================================
--- trunk/tools/RosBE-Windows/Tools/scut.c (original)
+++ trunk/tools/RosBE-Windows/Tools/scut.c Mon Nov 5 16:04:18 2007
@@ -25,6 +25,7 @@
char shortcutfile[260];
PSHORTCUT addshortcut(PSHORTCUT ptr, char* name, char* path);
+void checkfile(void);
int checkname(PSHORTCUT head, char* name);
int checkpath(char* path); // Alters path by fully expanding it.
void defaultshortcut(char* name);
@@ -44,6 +45,7 @@
strcpy(shortcutfile, getenv("APPDATA"));
strcat(shortcutfile, "\\RosBE\\srclist.txt");
+ checkfile();
if (argc > 4)
{
@@ -324,6 +326,36 @@
return ptr;
}
+void checkfile(void)
+{
+ FILE *FILE;
+
+ FILE = fopen(shortcutfile, "r");
+ if (!FILE)
+ {
+ FILE = fopen(shortcutfile, "w");
+ if (!FILE)
+ {
+ fprintf(stderr, "%s: Error creating file.\n", programname);
+ }
+ else
+ {
+ fprintf(FILE, "Default,Default\n");
+ if (fclose(FILE))
+ {
+ fprintf(stderr, "%s: Error closing file.\n", programname);
+ }
+ }
+ }
+ else
+ {
+ if (fclose(FILE))
+ {
+ fprintf(stderr, "%s: Error closing file.\n", programname);
+ }
+ }
+}
+
int checkname(PSHORTCUT head, char* name)
{
PSHORTCUT current = head;