Change #278828
| Category | gtar |
| Changed by | Paul Eggert <eggert@cs.ucla.edu> |
| Changed at | Fri 21 Aug 2026 00:46:21 |
| Repository | git://git.savannah.gnu.org/tar.git |
| Project | gtar |
| Branch | master |
| Revision | 0713d3502a0717347a0af62c3afd61e537b4bcc7 |
Comments
tar: refactor fdbase_opendir * src/misc.c (fdbase_opendir): Rename locals to more clearly distinguish new subdirectory name from old. Cache c->subdir and c->subdirlen to help the compiler warn us statically if we mess up. Move the large part of an if that ends in a break to be out of the loop, to make things a bit clearer and reduce indentation. Distinguish whether the new name is a subdirectory of the old, from whether the new name extends the old; they are not the same thing as the new and old names can have different chdir_fd values. If the new name extends the old, don’t overwrite the old name; just store into the old name’s extension. Although these changes improve performance with long names, the primary goal is to clarify the code, not performance.
Changed files
- src/misc.c