| 204 | } |
| 205 | |
| 206 | static size_t get_path_prefix(const char *path, size_t pathlen, size_t maxlen) |
| 207 | { |
| 208 | size_t i = pathlen; |
| 209 | if (i > 1 && path[i - 1] == '/') |
| 210 | i--; |
| 211 | if (i > maxlen) |
| 212 | i = maxlen; |
| 213 | do { |
| 214 | i--; |
| 215 | } while (i > 0 && path[i] != '/'); |
| 216 | return i; |
| 217 | } |
| 218 | |
| 219 | static void prepare_header(struct archiver_args *args, |
| 220 | struct ustar_header *header, |