On Fri, Jul 15, 2005 at 01:21:11PM +0100, Dave Korn wrote:
----Original Message----
From: Jason Tishler
Sent: 15 July 2005 12:27
Exactly! Right after my previous post, I started to investigate
enhancing rebase to support rebaseall functionality. I quickly
realized that this change would not require too much effort.
Reading the .gz files will probably be the worst bit of it!
Actually, the above was much easier than I thought. I came up with the
following test program in just a few minutes:
#include <stdio.h>
#include <string.h>
#include <zlib.h>
int
main(int argc, const char* argv[])
{
const char* filename = argv[1];
const char* mode = "rb";
const int size = 1024;
char buffer[size];
gzFile file = gzopen(filename, mode);
while (gzgets(file, buffer, size) > 0)
{
int length = strlen(buffer);
if (buffer[length - 1] == '\n')
buffer[length - 1] = '\0';
puts(buffer);
}
gzclose(file);
}