Add some comments to better understand the code
Axel Beckert
10 years ago
531 | 531 | # only match program in /usr (ex.: /usr/sbin/smokeping) |
532 | 532 | # ignore child, etc. |
533 | 533 | #m = re.search(r'^(([/]\w*){1,5})\s.*$', cmdline.read()) |
534 | # Split by null-bytes, see proc(5) | |
534 | 535 | data = cmdline.read().split('\x00') |
536 | # Last character should be null-byte, too, see proc(5) | |
535 | 537 | if not data[-1]: data.pop() |
536 | 538 | # Strip first value, the interpreter |
537 | 539 | data.pop(0) |