(lst, prefix)
| 1845 | return file_path_from_root |
| 1846 | |
| 1847 | def StripListPrefix(lst, prefix): |
| 1848 | # f(['x', 'y'], ['w, z']) -> None (not a valid prefix) |
| 1849 | if lst[:len(prefix)] != prefix: |
| 1850 | return None |
| 1851 | # f(['a, 'b', 'c', 'd'], ['a', 'b']) -> ['c', 'd'] |
| 1852 | return lst[(len(prefix)):] |
| 1853 | |
| 1854 | # root behavior: |
| 1855 | # --root=subdir , lstrips subdir from the header guard |