| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: rpm2pkg.c,v 1.17 2010/09/08 22:41:39 tron Exp $ */ | | 1 | /* $NetBSD: rpm2pkg.c,v 1.18 2010/11/11 13:07:34 tron Exp $ */ |
2 | | | 2 | |
3 | /*- | | 3 | /*- |
4 | * Copyright (c) 2001-2010 The NetBSD Foundation, Inc. | | 4 | * Copyright (c) 2001-2010 The NetBSD Foundation, Inc. |
5 | * All rights reserved. | | 5 | * All rights reserved. |
6 | * | | 6 | * |
7 | * This code is derived from software contributed to The NetBSD Foundation | | 7 | * This code is derived from software contributed to The NetBSD Foundation |
8 | * by Matthias Scheler. | | 8 | * by Matthias Scheler. |
9 | * | | 9 | * |
10 | * Redistribution and use in source and binary forms, with or without | | 10 | * Redistribution and use in source and binary forms, with or without |
11 | * modification, are permitted provided that the following conditions | | 11 | * modification, are permitted provided that the following conditions |
12 | * are met: | | 12 | * are met: |
13 | * 1. Redistributions of source code must retain the above copyright | | 13 | * 1. Redistributions of source code must retain the above copyright |
14 | * notice, this list of conditions and the following disclaimer. | | 14 | * notice, this list of conditions and the following disclaimer. |
| @@ -934,27 +934,28 @@ main(int argc, char **argv) | | | @@ -934,27 +934,28 @@ main(int argc, char **argv) |
934 | if (Ignore != NULL) { | | 934 | if (Ignore != NULL) { |
935 | char **Ptr; | | 935 | char **Ptr; |
936 | | | 936 | |
937 | Ptr = Ignore; | | 937 | Ptr = Ignore; |
938 | while (*Ptr != NULL) { | | 938 | while (*Ptr != NULL) { |
939 | if (CheckPrefix(*Ptr, Name)) { | | 939 | if (CheckPrefix(*Ptr, Name)) { |
940 | Fields[CPIO_HDR_MODE] = 0; | | 940 | Fields[CPIO_HDR_MODE] = 0; |
941 | break; | | 941 | break; |
942 | } | | 942 | } |
943 | Ptr++; | | 943 | Ptr++; |
944 | } | | 944 | } |
945 | } | | 945 | } |
946 | | | 946 | |
947 | if ((Name = StripPrefix(Name, StripCount)) == NULL) { | | 947 | if (Fields[CPIO_HDR_MODE] != 0 && |
| | | 948 | (Name = StripPrefix(Name, StripCount)) == NULL) { |
948 | (void)fprintf(stderr, | | 949 | (void)fprintf(stderr, |
949 | "%s: Leading path to strip too " | | 950 | "%s: Leading path to strip too " |
950 | "big (-s %d)\n", | | 951 | "big (-s %d)\n", |
951 | argv[Index], StripCount); | | 952 | argv[Index], StripCount); |
952 | return EXIT_FAILURE; | | 953 | return EXIT_FAILURE; |
953 | } | | 954 | } |
954 | | | 955 | |
955 | if (Prefix != NULL) { | | 956 | if (Prefix != NULL) { |
956 | char *Fullname; | | 957 | char *Fullname; |
957 | | | 958 | |
958 | Fullname = StrCat(Prefix, Name); | | 959 | Fullname = StrCat(Prefix, Name); |
959 | free(Name); | | 960 | free(Name); |
960 | Name = Fullname; | | 961 | Name = Fullname; |