aboutsummaryrefslogtreecommitdiff
path: root/man/man3/cleanname.3
diff options
context:
space:
mode:
authorrsc <devnull@localhost>2004-04-10 18:53:55 +0000
committerrsc <devnull@localhost>2004-04-10 18:53:55 +0000
commitcfa37a7b1131abbab2e7d339b451f5f0e3198cc8 (patch)
treea7fe52416e9d27efe2af2d54910112674c0fd7c6 /man/man3/cleanname.3
parent08df2a433e69c94f9db002c83380cb2b693fee60 (diff)
downloadplan9port-cfa37a7b1131abbab2e7d339b451f5f0e3198cc8.tar.gz
plan9port-cfa37a7b1131abbab2e7d339b451f5f0e3198cc8.tar.bz2
plan9port-cfa37a7b1131abbab2e7d339b451f5f0e3198cc8.zip
Lots of man pages.
Diffstat (limited to 'man/man3/cleanname.3')
-rw-r--r--man/man3/cleanname.334
1 files changed, 34 insertions, 0 deletions
diff --git a/man/man3/cleanname.3 b/man/man3/cleanname.3
new file mode 100644
index 00000000..7decd18d
--- /dev/null
+++ b/man/man3/cleanname.3
@@ -0,0 +1,34 @@
+.TH CLEANNAME 3
+.SH NAME
+cleanname \- clean a path name
+.SH SYNOPSIS
+.B #include <u.h>
+.br
+.B #include <libc.h>
+.sp
+.B
+char* cleanname(char *filename)
+.SH DESCRIPTION
+.I Cleanname
+takes a
+.I filename
+and by lexical processing only returns the shortest string that names the same (possibly
+hypothetical) file.
+It eliminates multiple and trailing slashes, and it lexically interprets
+.B .
+and
+.B ..
+directory components in the name.
+The string is overwritten in place.
+.PP
+The shortest string
+.I cleanname
+can return is two bytes: the null-terminated string
+\f(CW"."\f1.
+Therefore
+.I filename
+must contain room for at least two bytes.
+.SH SOURCE
+.B /sys/src/libc/port/cleanname.c
+.SH SEE ALSO
+.IR cleanname (1)