]> Kevux Git Server - rit/commit
path: factor out skip_slashes() in normalize_path_copy_len()
authorPushkar Singh <pushkarkumarsingh1970@gmail.com>
Sat, 21 Feb 2026 11:05:12 +0000 (11:05 +0000)
committerJunio C Hamano <gitster@pobox.com>
Sun, 22 Feb 2026 05:25:56 +0000 (21:25 -0800)
commit40b30f245d57f89215f89c29b72e8b557f09b82a
tree5cd9936acc0853ac248dadde78e3c3313bd9e0c9
parent7c02d39fc2ed2702223c7674f73150d9a7e61ba4
path: factor out skip_slashes() in normalize_path_copy_len()

Extract skip_slashes() to avoid repeating the same is_dir_sep()
loop in multiple places inside normalize_path_copy_len().

Keep the dot-component handling inline to preserve the original
control flow and readability, as suggested in review.

No functional changes. Behavior verified with t0060-path-utils.sh.

Signed-off-by: Pushkar Singh <pushkarkumarsingh1970@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
path.c