regedit: Add support for 'regedit -' for feeding regedit from stdin.

This commit is contained in:
Francois Gouget 2007-10-09 21:04:28 +02:00 committed by Alexandre Julliard
parent 01e7891d48
commit 09641eeddb
1 changed files with 31 additions and 16 deletions

View File

@ -138,7 +138,15 @@ static BOOL PerformRegAction(REGEDIT_ACTION action, LPSTR s)
while(filename[0]) {
char* realname = NULL;
if (strcmp(filename, "-") == 0)
{
reg_file=stdin;
}
else
{
int size;
size=SearchPath(NULL, filename, NULL,0, NULL, NULL);
if (size>0)
{
@ -158,6 +166,7 @@ static BOOL PerformRegAction(REGEDIT_ACTION action, LPSTR s)
fprintf(stderr,"%s: Can't open file \"%s\"\n", getAppName(), filename);
exit(1);
}
}
processRegLines(reg_file);
if (realname)
{
@ -240,6 +249,12 @@ BOOL ProcessCmdLine(LPSTR lpCmdLine)
s++;
ch = *s;
if (!ch || isspace(ch))
{
/* '-' is a file name. It indicates we should use stdin */
s--;
break;
}
ch2 = *(s+1);
chu = toupper(ch);
if (!ch2 || isspace(ch2)) {