This is the mail archive of the cygwin-patches@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Patch] cygcheck: warn about trailing (back)slash on mount entries


On Wed, Oct 06, 2004 at 03:12:45PM +0200, Bas van Gompel wrote:
>Another (hopefully trivial) patch, to help in trouble-shooting.

Wasn't there another problem where "foo\/bar" type of entries were
showing up?  Could you add a check for that, too?

Otherwise, this is fine.

cgf

>ChangeLog-entry:
>
>2004-10-06  Bas van Gompel  <cygwin-patch.buzz@bavag.tmfweb.nl>
>
>	* cygcheck.cc (dump_sysinfo): Warn about trailing (back)slash on mount
>	entries.
>
>
>--- src/winsup/utils/cygcheck.cc	6 Oct 2004 09:46:40 -0000	1.45
>+++ src/winsup/utils/cygcheck.cc	6 Oct 2004 11:59:58 -0000
>@@ -1165,19 +1165,25 @@ dump_sysinfo ()
>   printf ("\n");
> 
>   unsigned ml_fsname = 4, ml_dir = 7, ml_type = 6;
>+  bool ml_trailing = false;
> 
>   struct mntent *mnt;
>   setmntent (0, 0);
>   while ((mnt = getmntent (0)))
>     {
>       unsigned n = (int) strlen (mnt->mnt_fsname);
>+      ml_trailing |= (n > 1 && strchr ("\\/", mnt->mnt_fsname[n - 1]));
>       if (ml_fsname < n)
> 	ml_fsname = n;
>       n = (int) strlen (mnt->mnt_dir);
>+      ml_trailing |= (n > 1 && strchr ("\\/", mnt->mnt_dir[n - 1]));
>       if (ml_dir < n)
> 	ml_dir = n;
>     }
> 
>+  if (ml_trailing)
>+    puts ("Warning: Mount entries should not have a trailing (back)slash\n");
>+
>   if (givehelp)
>     {
>       printf
>
>L8r,
>
>Buzz (by special request).
>-- 
>  ) |  | ---/ ---/  Yes, this | This message consists of true | I do not
>--  |  |   /    /   really is |   and false bits entirely.    | mail for
>  ) |  |  /    /    a 72 by 4 +-------------------------------+ any1 but
>--  \--| /--- /---  .sigfile. |   |perl -pe "s.u(z)\1.as."    | me. 4^re


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]