Accept a leading "./" for the control file name, but don't mandate it.
authorgraham.gower <graham.gower@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
Tue, 24 Aug 2010 04:09:34 +0000 (04:09 +0000)
committergraham.gower <graham.gower@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
Tue, 24 Aug 2010 04:09:34 +0000 (04:09 +0000)
git-svn-id: http://opkg.googlecode.com/svn/trunk@558 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358

libbb/unarchive.c
libopkg/pkg_extract.c

index 0e820c8646a0946a3c7814e7731ca3e7d796d806..44f8715c16892e5b2d2cb3d7f5614503b76e10f2 100644 (file)
@@ -295,8 +295,13 @@ unarchive(FILE *src_stream, FILE *out_stream,
 
                if (extract_names != NULL) {
                        int found_flag = FALSE;
 
                if (extract_names != NULL) {
                        int found_flag = FALSE;
+                       char *p = file_entry->name;
+
+                       if (p[0] == '.' && p[1] == '/')
+                               p += 2;
+
                        for(i = 0; extract_names[i] != 0; i++) {
                        for(i = 0; extract_names[i] != 0; i++) {
-                               if (strcmp(extract_names[i], file_entry->name) == 0) {
+                               if (strcmp(extract_names[i], p) == 0) {
                                        found_flag = TRUE;
                                        break;
                                }
                                        found_flag = TRUE;
                                        break;
                                }
index b7d924c7d56cc8932379bd86805d076647d54b23..0f21e4011d418b32a0ab285202a7db4631032e6f 100644 (file)
@@ -29,8 +29,7 @@ pkg_extract_control_file_to_stream(pkg_t *pkg, FILE *stream)
        deb_extract(pkg->local_filename, stream,
                        extract_control_tar_gz
                        | extract_to_stream,
        deb_extract(pkg->local_filename, stream,
                        extract_control_tar_gz
                        | extract_to_stream,
-                       NULL, "./control", &err);
-
+                       NULL, "control", &err);
        return err;
 }
 
        return err;
 }