From: Scott Gasch Date: Thu, 2 Jun 2016 15:45:53 +0000 (-0700) Subject: Update email. X-Git-Url: https://wannabe.guru.org/gitweb/?a=commitdiff_plain;h=e1bc8452e688dc1f5bdcf66a493abd48341d3698;p=batch.git Update email. --- diff --git a/myecho/myecho.c b/myecho/myecho.c index c4657a2..906744b 100644 --- a/myecho/myecho.c +++ b/myecho/myecho.c @@ -16,23 +16,23 @@ Abstract: myecho.exe [-fg color] [-bg color] "string to echo" color can be: blue, red, green, yellow, cyan, violet, pink, black, white - brightblue, brightred, brightgreen, brightyellow, + brightblue, brightred, brightgreen, brightyellow, brightviolet, brightpink, brightblack, gray, grey, or brightwhite Author: - Scott Gasch (scott@wannabe.guru.org) 22 Aug 2002 + Scott Gasch (scott@gasch.org) 22 Aug 2002 Revision History: --*/ -#include +#include #include #include -WORD +WORD MakeColor(BOOL fBg, char *sz) /*++ @@ -55,7 +55,7 @@ Return value: // // bright - // + // if (strstr(sz, "bright")) { w = FOREGROUND_INTENSITY; @@ -63,7 +63,7 @@ Return value: // // colors - // + // if (strstr(sz, "blue")) { w |= FOREGROUND_BLUE; @@ -111,7 +111,7 @@ Return value: } -int __cdecl +int __cdecl main(int argc, char *argv[]) /*++ @@ -130,7 +130,7 @@ Return value: --*/ { - CONSOLE_SCREEN_BUFFER_INFO csbiInfo; + CONSOLE_SCREEN_BUFFER_INFO csbiInfo; HANDLE hStdOut; WORD wAttr; int x; @@ -138,7 +138,7 @@ Return value: // // open stdout - // + // hStdOut = GetStdHandle(STD_OUTPUT_HANDLE); if (INVALID_HANDLE_VALUE == hStdOut) { @@ -146,20 +146,20 @@ Return value: GetLastError()); exit(1); } - + // - // Save the current text colors. - // - if (0 == GetConsoleScreenBufferInfo(hStdOut, &csbiInfo)) + // Save the current text colors. + // + if (0 == GetConsoleScreenBufferInfo(hStdOut, &csbiInfo)) { - fprintf(stderr, "Failed to save current text attr, error=%u\n", + fprintf(stderr, "Failed to save current text attr, error=%u\n", GetLastError()); exit(1); } // // echo the string(s) - // + // x = 1; while (x < argc) { @@ -199,6 +199,6 @@ Return value: // // restore the old text colors - // + // (void)SetConsoleTextAttribute(hStdOut, csbiInfo.wAttributes); }