]> git.pld-linux.org Git - packages/rpm.git/blame - rpm-tar_as_secondary_source.patch
- at least use macros that are used
[packages/rpm.git] / rpm-tar_as_secondary_source.patch
CommitLineData
639079f5
ER
1--- rpm-4.5/rpmio/macro.c~ 2008-06-10 02:08:37.000000000 +0300
2+++ rpm-4.5/rpmio/macro.c 2008-06-10 02:08:59.476044991 +0300
3@@ -22,6 +22,7 @@
fa78cfd4 4 #include <stdio.h>
5 #include <stdlib.h>
6 #include <string.h>
7+#include <strings.h>
639079f5 8 #include <ctype.h>
fa78cfd4 9 #define rpmError fprintf
639079f5 10 #define rpmIsVerbose() (0)
fa78cfd4 11@@ -2106,6 +2107,7 @@ int isCompressed(const char * file, rpmC
12 ssize_t nb;
13 int rc = -1;
14 unsigned char magic[13];
15+ char *end, *ext;
16
17 *compressed = COMPRESSED_NOT;
18
19@@ -2131,6 +2133,11 @@ int isCompressed(const char * file, rpmC
20
21 rc = 0;
22
23+ /* Tar archives will be recognized by filename. */
24+ end = strchr(file, '\0');
25+ ext = end - 4;
26+ if (ext > file && !strcasecmp(ext, ".tar")) return rc;
27+
28 if (magic[0] == 'B' && magic[1] == 'Z')
29 *compressed = COMPRESSED_BZIP2;
30 else
This page took 0.025369 seconds and 4 git commands to generate.