Blob
1 .TH CLEANNAME 32 .SH NAME3 cleanname \- clean a path name4 .SH SYNOPSIS5 .B #include <u.h>6 .br7 .B #include <libc.h>8 .sp9 .B10 char* cleanname(char *filename)11 .SH DESCRIPTION12 .I Cleanname13 takes a14 .I filename15 and by lexical processing only returns the shortest string that names the same (possibly16 hypothetical) file.17 It eliminates multiple and trailing slashes, and it lexically interprets18 .B .19 and20 .B ..21 directory components in the name.22 The string is overwritten in place.23 .PP24 The shortest string25 .I cleanname26 can return is two bytes: the null-terminated string27 \f(CW"."\f1.28 Therefore29 .I filename30 must contain room for at least two bytes.31 .SH SOURCE32 .B \*9/src/lib9/cleanname.c33 .SH SEE ALSO34 .IR cleanname (1)