Author: cwittich
Date: Sun Feb 3 00:52:46 2008
New Revision: 32097
URL:
http://svn.reactos.org/svn/reactos?rev=32097&view=rev
Log:
add support for /macrofile (bit hacky - but it should work for RosBE)
Modified:
trunk/reactos/base/applications/cmdutils/doskey/doskey.c
Modified: trunk/reactos/base/applications/cmdutils/doskey/doskey.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/cmdutils…
==============================================================================
--- trunk/reactos/base/applications/cmdutils/doskey/doskey.c (original)
+++ trunk/reactos/base/applications/cmdutils/doskey/doskey.c Sun Feb 3 00:52:46 2008
@@ -49,11 +49,17 @@
{
LPTSTR ptr;
+ while (*param == ' ')
+ param++;
+
/* error if no '=' found */
if ((ptr = _tcschr (param, _T('='))) == 0)
{
return 1;
}
+
+ while (*param == ' ')
+ param++;
/* Split rest into name and substitute */
*ptr++ = _T('\0');
@@ -68,6 +74,22 @@
return 0;
}
+static VOID ReadFromFile(LPTSTR param)
+{
+ FILE* fp;
+ char line[MAX_PATH];
+
+ /* FIXME */
+ param += 11;
+
+ fp = _tfopen(param,"r");
+ while ( fgets(line, MAX_PATH, fp) != NULL)
+ SetMacro(line);
+
+ fclose(fp);
+ return;
+}
+
int
main (int argc, char **argv)
{
@@ -77,6 +99,8 @@
if (argv[1][0] == '/')
{
+ if (strnicmp(argv[1], "/macrofile", 10) == 0)
+ ReadFromFile(argv[1]);
if (stricmp(argv[1], "/macros") == 0)
PrintAlias();
}