(lst, prefix)
| 2317 | return file_path_from_root |
| 2318 | |
| 2319 | def StripListPrefix(lst, prefix): |
| 2320 | # f(['x', 'y'], ['w, z']) -> None (not a valid prefix) |
| 2321 | if lst[:len(prefix)] != prefix: |
| 2322 | return None |
| 2323 | # f(['a, 'b', 'c', 'd'], ['a', 'b']) -> ['c', 'd'] |
| 2324 | return lst[(len(prefix)):] |
| 2325 | |
| 2326 | # root behavior: |
| 2327 | # --root=subdir , lstrips subdir from the header guard |