Commit in reactos/subsys/system/cmd on MAIN
color.c+16-91.3 -> 1.4
Patch by H�seyin Uslu <20194562@mail.baskent.edu.tr>
Check color passed on command line, make sure foreground and background
are not the same.

reactos/subsys/system/cmd
color.c 1.3 -> 1.4
diff -u -r1.3 -r1.4
--- color.c	7 Aug 2003 09:27:42 -0000	1.3
+++ color.c	19 Feb 2004 17:04:11 -0000	1.4
@@ -1,4 +1,4 @@
-/* $Id: color.c,v 1.3 2003/08/07 09:27:42 hbirr Exp $
+/* $Id: color.c,v 1.4 2004/02/19 17:04:11 gvg Exp $
  *
  *  COLOR.C - color internal command.
  *
@@ -68,19 +68,26 @@
 	CONSOLE_SCREEN_BUFFER_INFO csbi;
 	COORD coPos;
 
-	if (bFill == TRUE)
+	if ((wColor & 0xF) == (wColor &0xF0) >> 4)
 	{
-		GetConsoleScreenBufferInfo (hConsole, &csbi);
-
-		coPos.X = 0;
-		coPos.Y = 0;
-		FillConsoleOutputAttribute (hConsole,
+	  ConErrPuts (_T("Same colors error! (Background and foreground can't be the same color)")); 
+    }
+    else 
+    {
+	    if (bFill == TRUE)
+    	{
+    	     GetConsoleScreenBufferInfo (hConsole, &csbi);
+
+    	     coPos.X = 0;
+    	     coPos.Y = 0;
+    	     FillConsoleOutputAttribute (hConsole,
 		                            (WORD)(wColor & 0x00FF),
 		                            (csbi.dwSize.X)*(csbi.dwSize.Y),
 		                            coPos,
 		                            &dwWritten);
-	}
-	SetConsoleTextAttribute (hConsole, (WORD)(wColor & 0x00FF));
+        }
+        SetConsoleTextAttribute (hConsole, (WORD)(wColor & 0x00FF));
+    }
 }
 
 
CVSspam 0.2.8