Skip to content
  • Duy Nguyen's avatar
    path.c: make get_pathname() call sites return const char * · dcf69262
    Duy Nguyen authored and Junio C Hamano's avatar Junio C Hamano committed
    
    
    Before the previous commit, get_pathname returns an array of PATH_MAX
    length. Even if git_path() and similar functions does not use the
    whole array, git_path() caller can, in theory.
    
    After the commit, get_pathname() may return a buffer that has just
    enough room for the returned string and git_path() caller should never
    write beyond that.
    
    Make git_path(), mkpath() and git_path_submodule() return a const
    buffer to make sure callers do not write in it at all.
    
    This could have been part of the previous commit, but the "const"
    conversion is too much distraction from the core changes in path.c.
    
    Signed-off-by: default avatarNguyễn Thái Ngọc Duy <pclouds@gmail.com>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    dcf69262