mirror of
git://source.winehq.org/git/wine.git
synced 2024-10-15 06:41:38 +00:00
Reformat and cleanup the shrink.c file included in the documentation
for consistency with the Wine source.
This commit is contained in:
parent
ceecf12384
commit
4fae1e8faf
|
@ -403,31 +403,25 @@ wait: ff
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
void
|
int main (void)
|
||||||
main (void)
|
|
||||||
{
|
{
|
||||||
char buff[256], lastline[256];
|
char buff[256], lastline[256] = "";
|
||||||
int count;
|
int count = 0;
|
||||||
|
|
||||||
count = 0;
|
while (!feof (stdin))
|
||||||
lastline[0] = 0;
|
|
||||||
|
|
||||||
while (!feof (stdin))
|
|
||||||
{
|
{
|
||||||
fgets (buff, sizeof (buff), stdin);
|
fgets (buff, sizeof (buff), stdin);
|
||||||
if (strcmp (buff, lastline) == 0)
|
if (strcmp (buff, lastline))
|
||||||
{
|
{
|
||||||
count++;
|
if (count > 1)
|
||||||
}
|
printf ("# Last line repeated %i times #\n", count);
|
||||||
else
|
printf ("%s", buff);
|
||||||
{
|
strcpy (lastline, buff);
|
||||||
if (count > 1)
|
|
||||||
fprintf (stdout, "# Last line repeated %i times #\n", count);
|
|
||||||
fprintf (stdout, "%s", buff);
|
|
||||||
strcpy (lastline, buff);
|
|
||||||
count = 1;
|
count = 1;
|
||||||
}
|
}
|
||||||
|
else count++;
|
||||||
}
|
}
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
</programlisting>
|
</programlisting>
|
||||||
</para>
|
</para>
|
||||||
|
|
Loading…
Reference in a new issue