Author: cwittich
Date: Sun Feb 3 01:49:24 2008
New Revision: 32098
URL:
http://svn.reactos.org/svn/reactos?rev=32098&view=rev
Log:
build unicode version
Modified:
trunk/reactos/base/applications/cmdutils/doskey/doskey.c
trunk/reactos/base/applications/cmdutils/doskey/doskey.rbuild
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 01:49:24 2008
@@ -37,7 +37,7 @@
{
while (*Aliases != '\0')
{
- printf(_T("%s\n"), Aliases);
+ _tprintf(_T("%s\n"), Aliases);
Aliases = Aliases + lstrlen(Aliases);
Aliases++;
}
@@ -49,22 +49,25 @@
{
LPTSTR ptr;
- while (*param == ' ')
+ while (*param == _T(' '))
param++;
/* error if no '=' found */
if ((ptr = _tcschr (param, _T('='))) == 0)
- {
return 1;
- }
- while (*param == ' ')
+ while (*param == _T(' '))
param++;
+
+ while (*ptr == _T(' '))
+ ptr--;
/* Split rest into name and substitute */
*ptr++ = _T('\0');
partstrlwr (param);
+
+ _tprintf(_T("%s, %s\n"), ptr, param);
if (ptr[0] == _T('\0'))
AddConsoleAlias(param, NULL, _T("cmd.exe"));
@@ -74,17 +77,27 @@
return 0;
}
-static VOID ReadFromFile(LPTSTR param)
+static VOID ReadFromFile(LPSTR param)
{
FILE* fp;
char line[MAX_PATH];
+#ifdef UNICODE
+ WCHAR lineW[MAX_PATH];
+#endif
/* FIXME */
param += 11;
- fp = _tfopen(param,"r");
+ fp = fopen(param,"r");
while ( fgets(line, MAX_PATH, fp) != NULL)
+ {
+#ifdef UNICODE
+ MultiByteToWideChar(CP_ACP, 0, line, -1, lineW, MAX_PATH);
+ SetMacro(lineW);
+#else
SetMacro(line);
+#endif
+ }
fclose(fp);
return;
@@ -93,7 +106,10 @@
int
main (int argc, char **argv)
{
-
+#ifdef UNICODE
+ WCHAR lineW[MAX_PATH];
+#endif
+
if (argc < 2)
return 0;
@@ -106,10 +122,13 @@
}
else
{
+#ifdef UNICODE
+ MultiByteToWideChar(CP_ACP, 0, argv[1], -1, lineW, MAX_PATH);
+ SetMacro(lineW);
+#else
SetMacro(argv[1]);
+#endif
}
-
-
return 0;
}
Modified: trunk/reactos/base/applications/cmdutils/doskey/doskey.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/cmdutils…
==============================================================================
--- trunk/reactos/base/applications/cmdutils/doskey/doskey.rbuild (original)
+++ trunk/reactos/base/applications/cmdutils/doskey/doskey.rbuild Sun Feb 3 01:49:24
2008
@@ -3,6 +3,8 @@
<module name="doskey" type="win32cui"
installbase="system32" installname="doskey.exe">
<define name="_WIN32_IE">0x0501</define>
<define name="_WIN32_WINNT">0x0501</define>
+ <define name="UNICODE" />
+ <define name="_UNICODE" />
<library>kernel32</library>
<file>doskey.c</file>
<file>doskey.rc</file>