From 0cef8dcd86e54f0f1d31e20a05e696f485911cd4 Mon Sep 17 00:00:00 2001 From: "cantab.net!aia21" Date: Thu, 13 Nov 2003 14:51:43 +0000 Subject: [PATCH] Make ntfscat show all messages to stderr so output (on stdout) isn't corrupted. (Szaka) (Logical change 1.234) --- ntfsprogs/ntfscat.c | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/ntfsprogs/ntfscat.c b/ntfsprogs/ntfscat.c index 13be2e24..c58edbd6 100644 --- a/ntfsprogs/ntfscat.c +++ b/ntfsprogs/ntfscat.c @@ -41,8 +41,9 @@ static const char *EXEC_NAME = "ntfscat"; static struct options opts; GEN_PRINTF (Eprintf, stderr, NULL, FALSE) -GEN_PRINTF (Vprintf, stdout, &opts.verbose, TRUE) -GEN_PRINTF (Qprintf, stdout, &opts.quiet, FALSE) +GEN_PRINTF (Vprintf, stderr, &opts.verbose, TRUE) +GEN_PRINTF (Qprintf, stderr, &opts.quiet, FALSE) +GEN_PRINTF (Printf, stderr, NULL, FALSE) /** * version - Print version information about the program @@ -53,10 +54,10 @@ GEN_PRINTF (Qprintf, stdout, &opts.quiet, FALSE) */ void version (void) { - printf ("\n%s v%s - Concatenate files and print on the standard output.\n\n", + Printf ("\n%s v%s - Concatenate files and print on the standard output.\n\n", EXEC_NAME, VERSION); - printf ("Copyright (c) 2003 Richard Russon\n"); - printf ("\n%s\n%s%s\n", ntfs_gpl, ntfs_bugs, ntfs_home); + Printf ("Copyright (c) 2003 Richard Russon\n"); + Printf ("\n%s\n%s%s\n", ntfs_gpl, ntfs_bugs, ntfs_home); } /** @@ -68,7 +69,7 @@ void version (void) */ void usage (void) { - printf ("\nUsage: %s [options] device file\n" + Printf ("\nUsage: %s [options] device file\n" " -f --force Use less caution\n" " -h --help Print this help\n" " -q --quiet Less output\n" @@ -80,7 +81,7 @@ void usage (void) //" -N --name Display this attribute name", //" -r --raw Display the compressed or encrypted file", EXEC_NAME); - printf ("%s%s\n", ntfs_bugs, ntfs_home); + Printf ("%s%s\n", ntfs_bugs, ntfs_home); } /** @@ -231,13 +232,13 @@ int main (int argc, char *argv[]) vol = utils_mount_volume (opts.device, MS_RDONLY, opts.force); if (!vol) { - printf ("!vol\n"); + Printf ("!vol\n"); return 1; } inode = utils_pathname_to_inode (vol, NULL, opts.file); if (!inode) { - printf ("!inode\n"); + Printf ("!inode\n"); return 1; } @@ -246,9 +247,9 @@ int main (int argc, char *argv[]) ntfs_inode_close (inode); ntfs_umount (vol, FALSE); if (result) - ;//printf ("failed\n"); + ;//Printf ("failed\n"); else - ;//printf ("success\n"); + ;//Printf ("success\n"); return result; }