Skip to content
Snippets Groups Projects
  • Iustin Pop's avatar
    SetEtcHostsEntry: maintain existing ordering · 8f9a87c5
    Iustin Pop authored
    
    Currently RemoveEtcHostsEntry keeps the ordering, but SetEtcHostsEntry
    not, as it will always write the new entry at the end of file. I
    personally dislike this as it "uglifies" my custom host files, so this
    patch makes it update the record instead in-place so to say instead of
    moving it.
    
    The patch also simplifies the construction of the new line (we were
    doing duplicate work for no gain).
    
    Signed-off-by: default avatarIustin Pop <iustin@google.com>
    Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
    8f9a87c5