diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2014-12-19 00:12:07 +0100 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2014-12-19 00:12:07 +0100 |
commit | 8e3c26e98bcf30dd73a8c64bb9aab08e2f32c1f8 (patch) | |
tree | fe40b56714f1d8a2e4f1ec26b6c07f1fcf396fd9 /libdiskfs | |
parent | 89c2cbb53b8ad14ae9d5d06ec230a696bea4a6ba (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 'libdiskfs')
-rw-r--r-- | libdiskfs/dir-lookup.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libdiskfs/dir-lookup.c b/libdiskfs/dir-lookup.c index e2287451..f3364cd6 100644 --- a/libdiskfs/dir-lookup.c +++ b/libdiskfs/dir-lookup.c @@ -327,7 +327,7 @@ diskfs_S_dir_lookup (struct protid *dircred, translator_path[end - path_start] = '\0'; } - if (dircred->po->path == NULL) + if (dircred->po->path == NULL || !strcmp (dircred->po->path,".")) /* dircred is the root directory. */ complete_path = translator_path; else @@ -528,7 +528,7 @@ diskfs_S_dir_lookup (struct protid *dircred, if (! error) { free (newpi->po->path); - if (dircred->po->path == NULL) + if (dircred->po->path == NULL || !strcmp (dircred->po->path,".")) { /* dircred is the root directory. */ newpi->po->path = relpath; |