* cygcheck.cc (dump_sysinfo): Warn about trailing (back)slash on mount entries.
This commit is contained in:
		| @@ -1,3 +1,8 @@ | |||||||
|  | 2004-10-10  Bas van Gompel  <cygwin-patch.buzz@bavag.tmfweb.nl> | ||||||
|  |  | ||||||
|  | 	* cygcheck.cc (dump_sysinfo): Warn about trailing (back)slash on mount | ||||||
|  | 	entries. | ||||||
|  |  | ||||||
| 2004-10-10  Bas van Gompel  <cygwin-patch.buzz@bavag.tmfweb.nl> | 2004-10-10  Bas van Gompel  <cygwin-patch.buzz@bavag.tmfweb.nl> | ||||||
|  |  | ||||||
| 	* cygcheck.cc (dump_sysinfo): Don't warn about empty path components, | 	* cygcheck.cc (dump_sysinfo): Don't warn about empty path components, | ||||||
|   | |||||||
| @@ -1165,19 +1165,25 @@ dump_sysinfo () | |||||||
|   printf ("\n"); |   printf ("\n"); | ||||||
|  |  | ||||||
|   unsigned ml_fsname = 4, ml_dir = 7, ml_type = 6; |   unsigned ml_fsname = 4, ml_dir = 7, ml_type = 6; | ||||||
|  |   bool ml_trailing = false; | ||||||
|  |  | ||||||
|   struct mntent *mnt; |   struct mntent *mnt; | ||||||
|   setmntent (0, 0); |   setmntent (0, 0); | ||||||
|   while ((mnt = getmntent (0))) |   while ((mnt = getmntent (0))) | ||||||
|     { |     { | ||||||
|       unsigned n = (int) strlen (mnt->mnt_fsname); |       unsigned n = (int) strlen (mnt->mnt_fsname); | ||||||
|  |       ml_trailing |= (n > 1 && strchr ("\\/", mnt->mnt_fsname[n - 1])); | ||||||
|       if (ml_fsname < n) |       if (ml_fsname < n) | ||||||
| 	ml_fsname = n; | 	ml_fsname = n; | ||||||
|       n = (int) strlen (mnt->mnt_dir); |       n = (int) strlen (mnt->mnt_dir); | ||||||
|  |       ml_trailing |= (n > 1 && strchr ("\\/", mnt->mnt_dir[n - 1])); | ||||||
|       if (ml_dir < n) |       if (ml_dir < n) | ||||||
| 	ml_dir = n; | 	ml_dir = n; | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  |   if (ml_trailing) | ||||||
|  |     puts ("Warning: Mount entries should not have a trailing (back)slash\n"); | ||||||
|  |  | ||||||
|   if (givehelp) |   if (givehelp) | ||||||
|     { |     { | ||||||
|       printf |       printf | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user