diff options
author | Reinhard Tartler <siretart@tauware.de> | 2011-10-10 17:43:39 +0200 |
---|---|---|
committer | Reinhard Tartler <siretart@tauware.de> | 2011-10-10 17:43:39 +0200 |
commit | f4092abdf94af6a99aff944d6264bc1284e8bdd4 (patch) | |
tree | 2ac1c9cc16ceb93edb2c4382c088dac5aeafdf0f /nx-X11/extras/rman/contrib/gzip.patch | |
parent | a840692edc9c6d19cd7c057f68e39c7d95eb767d (diff) | |
download | nx-libs-f4092abdf94af6a99aff944d6264bc1284e8bdd4.tar.gz nx-libs-f4092abdf94af6a99aff944d6264bc1284e8bdd4.tar.bz2 nx-libs-f4092abdf94af6a99aff944d6264bc1284e8bdd4.zip |
Imported nx-X11-3.1.0-1.tar.gznx-X11/3.1.0-1
Summary: Imported nx-X11-3.1.0-1.tar.gz
Keywords:
Imported nx-X11-3.1.0-1.tar.gz
into Git repository
Diffstat (limited to 'nx-X11/extras/rman/contrib/gzip.patch')
-rw-r--r-- | nx-X11/extras/rman/contrib/gzip.patch | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/nx-X11/extras/rman/contrib/gzip.patch b/nx-X11/extras/rman/contrib/gzip.patch new file mode 100644 index 000000000..d10666b6a --- /dev/null +++ b/nx-X11/extras/rman/contrib/gzip.patch @@ -0,0 +1,46 @@ +--- rman.c.~1~ Wed Nov 20 13:33:52 1996 ++++ rman.c Fri Oct 24 00:10:56 1997 +@@ -3583,6 +3583,43 @@ + } + free(sobuf); + } ++ } else { ++#define GZIP "/bin/gzip" ++ char * gz = malloc(strlen(p)+3+1); ++ sprintf(gz, "%s.gz", p); ++ if (stat(gz, &fileinfo)==0) { ++ /* first, figure out how big */ ++ char * cmd = malloc(strlen(gz) + strlen(GZIP) + 7 + 1); ++ char buffer[512]; ++ unsigned long compr, uncomp; ++ FILE * proc; ++ sprintf(cmd, "%s -l \"%s\"", GZIP, gz); ++ proc = popen(cmd, "r"); ++ fgets(buffer, sizeof buffer, proc); /* label line */ ++ fgets(buffer, sizeof buffer, proc); /* length line */ ++ sscanf(buffer, "%lu %lu", &compr, &uncomp); ++ fclose(proc); ++ /* Boy, don't you wish stat would do that? */ ++ sobuf = malloc(uncomp + 1); ++ if (sobuf!=NULL) { ++ /* suck in entire file, as above */ ++ sprintf(cmd, "%s -dc \"%s\"", GZIP, gz); ++ proc = popen(cmd, "r"); ++ if (proc!=NULL) { ++ if(fread(sobuf, 1, uncomp, proc)) { ++ sobuf[uncomp]='\0'; ++ for (q=sobuf; (q=strstr(q," \\}"))!=NULL; q+=3) *q='\n'; ++ source_subfile(sobuf); ++ err = 0; ++ } ++ fclose(proc); ++ } ++ free(sobuf); ++ } ++ free(cmd); ++ } ++ free(gz); ++ + } + + if (err) { |