regedit: Add support for 'regedit /E -', to export the registry to stdout.
This commit is contained in:
parent
09641eeddb
commit
ea5d653f3e
|
@ -832,12 +832,19 @@ static void export_hkey(FILE *file, HKEY key,
|
||||||
*/
|
*/
|
||||||
static FILE *REGPROC_open_export_file(CHAR *file_name)
|
static FILE *REGPROC_open_export_file(CHAR *file_name)
|
||||||
{
|
{
|
||||||
FILE *file = fopen(file_name, "w");
|
FILE *file;
|
||||||
|
|
||||||
|
if (strcmp(file_name,"-")==0)
|
||||||
|
file=stdout;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
file = fopen(file_name, "w");
|
||||||
if (!file) {
|
if (!file) {
|
||||||
perror("");
|
perror("");
|
||||||
fprintf(stderr,"%s: Can't open file \"%s\"\n", getAppName(), file_name);
|
fprintf(stderr,"%s: Can't open file \"%s\"\n", getAppName(), file_name);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
fputs("REGEDIT4\n", file);
|
fputs("REGEDIT4\n", file);
|
||||||
return file;
|
return file;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue