From 4fae1e8fafc4c921761dd39b28f27ed5a2cf5ce7 Mon Sep 17 00:00:00 2001 From: "Dimitrie O. Paun" Date: Tue, 27 Jan 2004 20:10:01 +0000 Subject: [PATCH] Reformat and cleanup the shrink.c file included in the documentation for consistency with the Wine source. --- documentation/implementation.sgml | 30 ++++++++++++------------------ 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/documentation/implementation.sgml b/documentation/implementation.sgml index c35587e1c9e..4ace0181b2d 100644 --- a/documentation/implementation.sgml +++ b/documentation/implementation.sgml @@ -403,31 +403,25 @@ wait: ff #include <stdio.h> #include <string.h> -void -main (void) +int main (void) { - char buff[256], lastline[256]; - int count; + char buff[256], lastline[256] = ""; + int count = 0; - count = 0; - lastline[0] = 0; - - while (!feof (stdin)) + while (!feof (stdin)) { - fgets (buff, sizeof (buff), stdin); - if (strcmp (buff, lastline) == 0) + fgets (buff, sizeof (buff), stdin); + if (strcmp (buff, lastline)) { - count++; - } - else - { - if (count > 1) - fprintf (stdout, "# Last line repeated %i times #\n", count); - fprintf (stdout, "%s", buff); - strcpy (lastline, buff); + if (count > 1) + printf ("# Last line repeated %i times #\n", count); + printf ("%s", buff); + strcpy (lastline, buff); count = 1; } + else count++; } + return 0; }