Skip to content
  • Ernestas Kulik's avatar
    file-utilities: rework common prefix computation · 61ac48bd
    Ernestas Kulik authored
    Currently, the process for getting the common prefix of a list of file
    names is a tad too greedy:
        1. Find the common prefix of all the strings.
        2. Strip the extension from the prefix.
        3. Strip trailing punctuation.
    
    Step 2 may strip dots if there’s trailing whitespace and step 3 may
    strip useful punctuation (e.g. parentheses). This commit reworks the
    process as such:
        1. Strip the extension from all the file names.
        2. Find the common prefix of all the strings.
        3. Trim trailing whitespace.
    
    Fixes #174.
    61ac48bd