diff options
author | Elliott Hughes <enh@google.com> | 2015-10-31 12:15:25 -0700 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2015-11-02 01:34:11 -0600 |
commit | 11d6079ed3cb067dc66a795a1c7565c13afd5a00 (patch) | |
tree | 82a93c8cdc80f69c86cb43e904b683121690166c /lib | |
parent | 71617b9ea00ed774c202346c9bf8ac2bf80dfc2e (diff) | |
download | toybox-11d6079ed3cb067dc66a795a1c7565c13afd5a00.tar.gz |
Add ps -Z.
As with ls, it doesn't seem like -Z should be guarded behind LSM
availability. On a non-SELinux system, the label is always "unconfined".
Diffstat (limited to 'lib')
-rw-r--r-- | lib/lib.c | 8 | ||||
-rw-r--r-- | lib/lib.h | 1 |
2 files changed, 9 insertions, 0 deletions
@@ -342,6 +342,14 @@ char *strlower(char *s) return try; } +char *chomp(char *s) +{ + char *p = strrchr(s, '\n'); + + if (p) *p = 0; + return s; +} + int unescape(char c) { char *from = "\\abefnrtv", *to = "\\\a\b\033\f\n\r\t\v"; @@ -168,6 +168,7 @@ long atolx(char *c); long atolx_range(char *numstr, long low, long high); int stridx(char *haystack, char needle); char *strlower(char *s); +char *chomp(char *s); int unescape(char c); int strstart(char **a, char *b); off_t fdlength(int fd); |