summaryrefslogtreecommitdiff
path: root/libnetfs
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2014-12-19 00:12:07 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2014-12-19 00:12:07 +0100
commit8e3c26e98bcf30dd73a8c64bb9aab08e2f32c1f8 (patch)
treefe40b56714f1d8a2e4f1ec26b6c07f1fcf396fd9 /libnetfs
parent89c2cbb53b8ad14ae9d5d06ec230a696bea4a6ba (diff)
Avoid ./ components in mtab output
* libdiskfs/dir-lookup.c (diskfs_S_dir_lookup): Match "." path as being the root directory. * libnetfs/dir-lookup.c (netfs_S_dir_lookup): Likewise.
Diffstat (limited to 'libnetfs')
-rw-r--r--libnetfs/dir-lookup.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libnetfs/dir-lookup.c b/libnetfs/dir-lookup.c
index 77cbbbd6..7ca526b7 100644
--- a/libnetfs/dir-lookup.c
+++ b/libnetfs/dir-lookup.c
@@ -310,7 +310,7 @@ netfs_S_dir_lookup (struct protid *diruser,
translator_path[end - filename_start] = '\0';
}
- if (diruser->po->path == NULL)
+ if (diruser->po->path == NULL || !strcmp (diruser->po->path,"."))
/* diruser is the root directory. */
complete_path = translator_path;
else
@@ -444,7 +444,7 @@ netfs_S_dir_lookup (struct protid *diruser,
}
free (newpi->po->path);
- if (diruser->po->path == NULL)
+ if (diruser->po->path == NULL || !strcmp (diruser->po->path,"."))
{
/* diruser is the root directory. */
newpi->po->path = relpath;