26a8abc spectool: ignore query string in URL. BZ 1337544

Authored and Committed by mdomonko 4 years ago
1 file changed. 1 lines added. 1 lines removed.
    spectool: ignore query string in URL. BZ 1337544
    
    When constructing the target filename from the given Source or Patch URL
    (sub retrieve), do not include the query string (if present).
    
    Example:
    * Before: http://some.url/foo.tgz?arg=123 => ./foo.tgz?arg=123
    * After:  http://some.url/foo.tgz?arg=123 => ./foo.tgz
    
    Regex explanation:
    * 1st group: ([^\/]+?)
        * Lazily matches one or more characters that are not a forward slash
    * 2nd group: (?:\?.*)?$
        * Matches a query string (if any) starting with a question mark,
          followed by zero or more characters until the end of string,
          without creating a capturing group (the leading ?:)
    
        
file modified
+1 -1