archive_write_set_format_v7tar.c (311041) | archive_write_set_format_v7tar.c (342360) |
---|---|
1/*- 2 * Copyright (c) 2003-2007 Tim Kientzle 3 * Copyright (c) 2011-2012 Michihiro NAKAJIMA 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 270 unchanged lines hidden (view full) --- 279 } else 280#endif 281 p = archive_entry_pathname(entry); 282 /* 283 * On Windows, this is a backup operation just in 284 * case getting WCS failed. On POSIX, this is a 285 * normal operation. 286 */ | 1/*- 2 * Copyright (c) 2003-2007 Tim Kientzle 3 * Copyright (c) 2011-2012 Michihiro NAKAJIMA 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 270 unchanged lines hidden (view full) --- 279 } else 280#endif 281 p = archive_entry_pathname(entry); 282 /* 283 * On Windows, this is a backup operation just in 284 * case getting WCS failed. On POSIX, this is a 285 * normal operation. 286 */ |
287 if (p != NULL && p[strlen(p) - 1] != '/') { | 287 if (p != NULL && p[0] != '\0' && p[strlen(p) - 1] != '/') { |
288 struct archive_string as; 289 290 archive_string_init(&as); 291 path_length = strlen(p); 292 if (archive_string_ensure(&as, 293 path_length + 2) == NULL) { 294 archive_set_error(&a->archive, ENOMEM, 295 "Can't allocate v7tar data"); --- 365 unchanged lines hidden --- | 288 struct archive_string as; 289 290 archive_string_init(&as); 291 path_length = strlen(p); 292 if (archive_string_ensure(&as, 293 path_length + 2) == NULL) { 294 archive_set_error(&a->archive, ENOMEM, 295 "Can't allocate v7tar data"); --- 365 unchanged lines hidden --- |