(lst, prefix)
| 2527 | return file_path_from_root |
| 2528 | |
| 2529 | def StripListPrefix(lst, prefix): |
| 2530 | # f(['x', 'y'], ['w, z']) -> None (not a valid prefix) |
| 2531 | if lst[: len(prefix)] != prefix: |
| 2532 | return None |
| 2533 | # f(['a, 'b', 'c', 'd'], ['a', 'b']) -> ['c', 'd'] |
| 2534 | return lst[(len(prefix)) :] |
| 2535 | |
| 2536 | # root behavior: |
| 2537 | # --root=subdir , lstrips subdir from the header guard |