Accept a leading "./" for the control file name, but don't mandate it.
[oweals/opkg-lede.git] / libbb / unarchive.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;
+                       char *p = file_entry->name;
+
+                       if (p[0] == '.' && p[1] == '/')
+                               p += 2;
+
                        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;
                                }