Skip to content
  • Johannes Schindelin's avatar
    Refactor skipping DOS drive prefixes · 2f36eed9
    Johannes Schindelin authored and Junio C Hamano's avatar Junio C Hamano committed
    
    
    Junio noticed that there is an implicit assumption in pretty much
    all the code calling has_dos_drive_prefix(): it forces all of its
    callsites to hardcode the knowledge that the DOS drive prefix is
    always two bytes long.
    
    While this assumption is pretty safe, we can still make the code
    more readable and less error-prone by introducing a function that
    skips the DOS drive prefix safely.
    
    While at it, we change the has_dos_drive_prefix() return value: it
    now returns the number of bytes to be skipped if there is a DOS
    drive prefix.
    
    Signed-off-by: default avatarJohannes Schindelin <johannes.schindelin@gmx.de>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    2f36eed9