Re: [Patch] cygcheck: warn about empty path-components

2004-10-12 Thread Igor Pechtchanski
On Tue, 12 Oct 2004, Christopher Faylor wrote:

> On Tue, Oct 12, 2004 at 06:26:36PM -0400, Igor Pechtchanski wrote:
> >On Tue, 12 Oct 2004, Christopher Faylor wrote:
> >
> >> On Wed, Oct 13, 2004 at 12:11:05AM +0200, Bas van Gompel wrote:
> >> >Op Sun, 10 Oct 2004 13:13:23 -0400 schreef Christopher Faylor:
> >> >:  On Sun, Oct 10, 2004 at 08:36:38AM +0200, Bas van Gompel wrote:
> >> >: > Op Sat, 9 Oct 2004 19:18:13 -0400 schreef Christopher Faylor
> >> >: > So cygcheck will have the same problem...
> >> >:
> >> >:   Right, but cygcheck can rely on the fact that cygwin1.dll is around, at
> >> >:  least, if necessary.
> >> >
> >> >The dll is/should be around after setup ran (in install-mode), as well.
> >>
> >> Right.  But it may not be loadable.  I don't know if you can still use
> >> LoadLibrary on dlls which lack the correct permissions or not.
> >
> >FYI: you can't.  Just tested on WinXP Pro.  HTH,
>
> Wow, that was fast.  Thanks for the feedback.
>
> cgf

You're welcome.  It helps to have a pre-compiled "loader.exe" executable
that does a dlopen(argv[1]) and prints the return value. :-D
Igor
-- 
http://cs.nyu.edu/~pechtcha/
  |\  _,,,---,,_[EMAIL PROTECTED]
ZZZzz /,`.-'`'-.  ;-;;,_[EMAIL PROTECTED]
 |,4-  ) )-,_. ,\ (  `'-'   Igor Pechtchanski, Ph.D.
'---''(_/--'  `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"Happiness lies in being privileged to work hard for long hours in doing
whatever you think is worth doing."  -- Dr. Jubal Harshaw


Re: [Patch] cygcheck: warn about empty path-components

2004-10-12 Thread Christopher Faylor
On Tue, Oct 12, 2004 at 06:26:36PM -0400, Igor Pechtchanski wrote:
>On Tue, 12 Oct 2004, Christopher Faylor wrote:
>
>> On Wed, Oct 13, 2004 at 12:11:05AM +0200, Bas van Gompel wrote:
>> >Op Sun, 10 Oct 2004 13:13:23 -0400 schreef Christopher Faylor:
>> >:  On Sun, Oct 10, 2004 at 08:36:38AM +0200, Bas van Gompel wrote:
>> >: > Op Sat, 9 Oct 2004 19:18:13 -0400 schreef Christopher Faylor
>> >: > So cygcheck will have the same problem...
>> >:
>> >:   Right, but cygcheck can rely on the fact that cygwin1.dll is around, at
>> >:  least, if necessary.
>> >
>> >The dll is/should be around after setup ran (in install-mode), as well.
>>
>> Right.  But it may not be loadable.  I don't know if you can still use
>> LoadLibrary on dlls which lack the correct permissions or not.
>
>FYI: you can't.  Just tested on WinXP Pro.  HTH,

Wow, that was fast.  Thanks for the feedback.

cgf


Re: [Patch] cygcheck: warn about empty path-components

2004-10-12 Thread Igor Pechtchanski
On Tue, 12 Oct 2004, Christopher Faylor wrote:

> On Wed, Oct 13, 2004 at 12:11:05AM +0200, Bas van Gompel wrote:
> >Op Sun, 10 Oct 2004 13:13:23 -0400 schreef Christopher Faylor:
> >:  On Sun, Oct 10, 2004 at 08:36:38AM +0200, Bas van Gompel wrote:
> >: > Op Sat, 9 Oct 2004 19:18:13 -0400 schreef Christopher Faylor
> >: > So cygcheck will have the same problem...
> >:
> >:   Right, but cygcheck can rely on the fact that cygwin1.dll is around, at
> >:  least, if necessary.
> >
> >The dll is/should be around after setup ran (in install-mode), as well.
>
> Right.  But it may not be loadable.  I don't know if you can still use
> LoadLibrary on dlls which lack the correct permissions or not.

FYI: you can't.  Just tested on WinXP Pro.  HTH,
Igor
-- 
http://cs.nyu.edu/~pechtcha/
  |\  _,,,---,,_[EMAIL PROTECTED]
ZZZzz /,`.-'`'-.  ;-;;,_[EMAIL PROTECTED]
 |,4-  ) )-,_. ,\ (  `'-'   Igor Pechtchanski, Ph.D.
'---''(_/--'  `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"Happiness lies in being privileged to work hard for long hours in doing
whatever you think is worth doing."  -- Dr. Jubal Harshaw


Re: [Patch] cygcheck: warn about empty path-components

2004-10-12 Thread Christopher Faylor
On Wed, Oct 13, 2004 at 12:11:05AM +0200, Bas van Gompel wrote:
>Op Sun, 10 Oct 2004 13:13:23 -0400 schreef Christopher Faylor
>in <[EMAIL PROTECTED]>:
>:  On Sun, Oct 10, 2004 at 08:36:38AM +0200, Bas van Gompel wrote:
>: > Op Sat, 9 Oct 2004 19:18:13 -0400 schreef Christopher Faylor
>: > So cygcheck will have the same problem...
>:
>:   Right, but cygcheck can rely on the fact that cygwin1.dll is around, at
>:  least, if necessary.
>
>The dll is/should be around after setup ran (in install-mode), as well.

Right.  But it may not be loadable.  I don't know if you can still use
LoadLibrary on dlls which lack the correct permissions or not.

>:  I guess a goal could be to come up with a generic
>:  library which did sanity checking and corrections on cygwin permissions.
>
>Which would than have to be linked statically, or suffer from it's
>own permission-problems...

Right.

>: > How about doing it from a (postinstall-)script?
>:
>:   A post-install script doesn't help if someone copied all of their stuff
>:  to a CD-ROM and then to a new system.
>
>I didn't think that was a supported procedure. (IOW: YOWTWYWT)

If we are just going to worry about people doing things perfectly with
setup.exe then we hardly need cygcheck at all.  cygcheck reports on
things that you can get from other utilities.  In fact, cygcheck doesn't
really need to be a mingw program if we can rely on the fact that
everything is ok on the system.

>A post-install script does have the advantage of being run from within
>cygwin.

You seem to be arguing for a post-install script when I've already said
that it would be a good idea to have a post-install script.

cgf


Re: [Patch] cygcheck: warn about empty path-components

2004-10-12 Thread Bas van Gompel
Op Sun, 10 Oct 2004 13:13:23 -0400 schreef Christopher Faylor
in <[EMAIL PROTECTED]>:
:  On Sun, Oct 10, 2004 at 08:36:38AM +0200, Bas van Gompel wrote:
: > Op Sat, 9 Oct 2004 19:18:13 -0400 schreef Christopher Faylor
: > So cygcheck will have the same problem...
:
:   Right, but cygcheck can rely on the fact that cygwin1.dll is around, at
:  least, if necessary.

The dll is/should be around after setup ran (in install-mode), as well.

:  I guess a goal could be to come up with a generic
:  library which did sanity checking and corrections on cygwin permissions.

Which would than have to be linked statically, or suffer from it's
own permission-problems...

: > How about doing it from a (postinstall-)script?
:
:   A post-install script doesn't help if someone copied all of their stuff
:  to a CD-ROM and then to a new system.

I didn't think that was a supported procedure. (IOW: YOWTWYWT)
A post-install script does have the advantage of being run from within
cygwin.

:  We really should improve setup, too, but I still think we need this in
:  two places.

Probably. It could also be done from _cygwin_dll_entry, or some such.

:  Maybe we could get by with just having a sanity shell script that could
:  be run but it still seems like it should be tied into cygcheck somehow.
:
:  Or, maybe we need a "cygfix"...

Or more options to cygcheck:

-F: try to fix. (implies -s)
-p: print commands to execute to try to fix. (implies -qs)
-q: suppress normal output.


L8r,

Buzz.
-- 
  ) |  | ---/ ---/  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


Re: [Patch] cygcheck: warn about empty path-components

2004-10-11 Thread Corinna Vinschen
On Oct  9 19:18, Christopher Faylor wrote:
> When I was at Red Hat, I tended to be slightly more lenient about
> assignment obligations for things in the utils directory.

I certainly don't object if we keep it this way.

> Corinna, do you think you could ask you-know-who if we could get a
> waiver for cygcheck changes?  It doesn't seem like cygcheck provides
> any core cygwin functionality.
> 
> We might even consider changing the license if Red Hat is amenable.

I've written a mail to you-know-who (I guess it's the same you-know-who
as the you-know-who you were thinking of), asking if we can change the
licensing of the utils directory to something relaxed (BSD, actually).


Corinna

-- 
Corinna Vinschen  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader  mailto:[EMAIL PROTECTED]
Red Hat, Inc.


Re: [Patch] cygcheck: warn about empty path-components

2004-10-09 Thread Christopher Faylor
On Sun, Oct 10, 2004 at 12:41:20AM +0200, Bas van Gompel wrote:
>Op Thu, 7 Oct 2004 20:17:55 -0400 schreef Christopher Faylor
>:  Of course, if someone can use cygcheck to diagnose their own problems
>:  then, that's great.  I don't see any reason to alarm someone with a
>:  warning about a minor issue like an empty path component when it
>:  is not an uncommon idiom, though.
>
>I see what you mean. I got the idea for the patch when reviewing a
>cygcheck.out which I first thought had 2 empty lines after the path.
>Further examination revealed the first of these held a TAB.
>
>I thought that was unclear. One might miss the fact there was an empty
>component.

So that should be replaced by a '.' then, not a warning.

>: > What are you planning to do? Will you revert this patch, reject the
>: > next patch and leave things as they are, or consider it when it's
>: > submitted?
>:
>:   I'm leaning to reverting the patch unless you can point me to a
>:  preponderance of email messages in the cygwin list which illustrate
>:  that this has been a common problem crying out for a warning.  Maybe
>:  I just missed something.
>
>You know there is no such thing. Would you anyhow consider the
>following patch, which just displays "." instead of the warning?

Heh.  Should have kept reading.  Yes, I like that better. I agree
that an empty line is unclear.

>:  If you are interested in adding real improvements to cygcheck, I'd
>:  suggest something to ensure that the permissions on system directories
>:  and files are sane, and maybe even a method to correct problems in that
>:  area.  That seems to be one of the biggest complaints in the mailing
>:  list.
>
>I'll see what I can do. I however doubt if this can be accomplished
>with a trivial patch. (I do have some more trivia in store...)

When I was at Red Hat, I tended to be slightly more lenient about
assignment obligations for things in the utils directory.

Corinna, do you think you could ask you-know-who if we could get a
waiver for cygcheck changes?  It doesn't seem like cygcheck provides
any core cygwin functionality.

We might even consider changing the license if Red Hat is amenable.

>(Would not corrections be misplaced in cygcheck?
>Is ensuring correct permissions not something better handled in setup?)

It should probably done in both places.  It's easy enough to screw up
permissions after setup.exe has been run and it seems like it is hard
for setup to set permissions correctly since it is not a cygwin program.

>ChangeLog-entry:
>
>2004-10-10  Bas van Gompel  <[EMAIL PROTECTED]>
>
>   * cygcheck.cc (dump_sysinfo): Don't warn about empty path-
>   components, just display ``.''.

Checked in.  Thanks for the patch and special thanks for keeping the
dialog going about your patch.  Your persistence is appreciated.

cgf


Re: [Patch] cygcheck: warn about empty path-components

2004-10-09 Thread Bas van Gompel
Op Thu, 7 Oct 2004 20:17:55 -0400 schreef Christopher Faylor
in <[EMAIL PROTECTED]>:
:  On Fri, Oct 08, 2004 at 01:42:05AM +0200, Bas van Gompel wrote:
: > : > :  Why are we bothering with this?
: > : >
: > : > If I may attempt to answer this one... Many people may not know of
: > : > this usage, yet may have their windows path ending on a ';'.
: > :
: > :   I'm sure the same thing is true on UNIX and yet it has survived for
: > :  years without a unicheck program informing people of this fact.
: >
: > There are no windows paths in UNIX, and there is no unicheck program
: > for any purpose. Does this mean cygcheck should be removed?
:
:   We're talking about paths, not "Windows paths".

We're talking about how paths are displayed by cygcheck.
It displays them using window's conventions.

[...]

:  Of course, if someone can use cygcheck to diagnose their own problems
:  then, that's great.  I don't see any reason to alarm someone with a
:  warning about a minor issue like an empty path component when it
:  is not an uncommon idiom, though.

I see what you mean. I got the idea for the patch when reviewing a
cygcheck.out which I first thought had 2 empty lines after the path.
Further examination revealed the first of these held a TAB.

I thought that was unclear. One might miss the fact there was an empty
component.

: > What are you planning to do? Will you revert this patch, reject the
: > next patch and leave things as they are, or consider it when it's
: > submitted?
:
:   I'm leaning to reverting the patch unless you can point me to a
:  preponderance of email messages in the cygwin list which illustrate
:  that this has been a common problem crying out for a warning.  Maybe
:  I just missed something.

You know there is no such thing. Would you anyhow consider the
following patch, which just displays "." instead of the warning?

:  If you are interested in adding real improvements to cygcheck, I'd
:  suggest something to ensure that the permissions on system directories
:  and files are sane, and maybe even a method to correct problems in that
:  area.  That seems to be one of the biggest complaints in the mailing
:  list.

I'll see what I can do. I however doubt if this can be accomplished
with a trivial patch. (I do have some more trivia in store...)

(Would not corrections be misplaced in cygcheck?
Is ensuring correct permissions not something better handled in setup?)


ChangeLog-entry:

2004-10-10  Bas van Gompel  <[EMAIL PROTECTED]>

* cygcheck.cc (dump_sysinfo): Don't warn about empty path-
components, just display ``.''.


--- src/winsup/utils/cygcheck.cc6 Oct 2004 09:46:40 -   1.45
+++ src/winsup/utils/cygcheck.cc9 Oct 2004 07:39:01 -
@@ -958,9 +958,9 @@ dump_sysinfo ()
 {
   for (e = s; *e && *e != sep; e++);
   if (e-s)
-printf ("\t%.*s\n", e - s, s);
+   printf ("\t%.*s\n", e - s, s);
   else
-puts ("\tWarning: Empty path-component");
+   puts ("\t.");
   count_path_items++;
   if (!*e)
break;


L8r,

Buzz.
-- 
  ) |  | ---/ ---/  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


Re: [Patch] cygcheck: warn about empty path-components

2004-10-07 Thread Christopher Faylor
On Fri, Oct 08, 2004 at 01:42:05AM +0200, Bas van Gompel wrote:
>: > :  Why are we bothering with this?
>: >
>: > If I may attempt to answer this one... Many people may not know of
>: > this usage, yet may have their windows path ending on a ';'.
>:
>:   I'm sure the same thing is true on UNIX and yet it has survived for
>:  years without a unicheck program informing people of this fact.
>
>There are no windows paths in UNIX, and there is no unicheck program
>for any purpose. Does this mean cygcheck should be removed?

We're talking about paths, not "Windows paths".

Cygcheck was invented as a bug reporting adjunct so that we wouldn't
have to keep asking people to send us the output of the mount command
and the which command and the env command, etc.  There are similar
programs on linux.  The name of the one that Red Hat uses escapes me
but, in Red Hat tech support, it was standard procedure to ask people to
include output from this program in their bug reports.

Of course, if someone can use cygcheck to diagnose their own problems
then, that's great.  I don't see any reason to alarm someone with a
warning about a minor issue like an empty path component when it
is not an uncommon idiom, though.

>What are you planning to do? Will you revert this patch, reject the
>next patch and leave things as they are, or consider it when it's
>submitted?

I'm leaning to reverting the patch unless you can point me to a
preponderance of email messages in the cygwin list which illustrate
that this has been a common problem crying out for a warning.  Maybe
I just missed something.

If you are interested in adding real improvements to cygcheck, I'd
suggest something to ensure that the permissions on system directories
and files are sane, and maybe even a method to correct problems in that
area.  That seems to be one of the biggest complaints in the mailing
list.

cgf


Re: [Patch] cygcheck: warn about empty path-components

2004-10-07 Thread Bas van Gompel
Op Wed, 6 Oct 2004 22:15:58 -0400 schreef Christopher Faylor
in <[EMAIL PROTECTED]>:
:  On Thu, Oct 07, 2004 at 04:05:14AM +0200, Bas van Gompel wrote:

[...]

: > s/-v/-h/. (I'm waiting for the other (trailing slash) patch to be
: > applied or rejected, before submitting this.)
:
:   I missed the part about the warning before but I *really* don't think we
:  need to warn the user about standard UNIX behavior in cygcheck.  That is
:  really not what's for.

It's for diagnosing problems with the cygwin-environment, isn't it?
The (to be) warned about condition is on the edge of windows and cygwin.
No windows or UNIX utility is going to warn about it.

[...]

: > :  Why are we bothering with this?
: >
: > If I may attempt to answer this one... Many people may not know of
: > this usage, yet may have their windows path ending on a ';'.
:
:   I'm sure the same thing is true on UNIX and yet it has survived for
:  years without a unicheck program informing people of this fact.

There are no windows paths in UNIX, and there is no unicheck program
for any purpose. Does this mean cygcheck should be removed?

What are you planning to do? Will you revert this patch, reject the
next patch and leave things as they are, or consider it when it's
submitted?

L8r,

Buzz.
-- 
  ) |  | ---/ ---/  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


Re: [Patch] cygcheck: warn about empty path-components

2004-10-06 Thread Christopher Faylor
On Thu, Oct 07, 2004 at 04:05:14AM +0200, Bas van Gompel wrote:
>Op Wed, 6 Oct 2004 10:58:05 -0400 schreef Christopher Faylor
>in <[EMAIL PROTECTED]>:
>:  On Wed, Oct 06, 2004 at 10:49:09AM +0200, Bas van Gompel wrote:
>
>[Empty path-components resolving to current dir.]
>
>: > (Maybe the message could get a ``-v'' addition like: ``This will
>: > resolve to the current directory when in cygwin''.)
>
>s/-v/-h/. (I'm waiting for the other (trailing slash) patch to be
>applied or rejected, before submitting this.)

I missed the part about the warning before but I *really* don't think we
need to warn the user about standard UNIX behavior in cygcheck.  That is
really not what's for.

>:  I see that Corinna has checked this in but I really don't see the need
>:  for a warning for a perfectly acceptable use of an empty PATH component.
>:
>:  Why are we bothering with this?
>
>If I may attempt to answer this one... Many people may not know of
>this usage, yet may have their windows path ending on a ';'.

I'm sure the same thing is true on UNIX and yet it has survived for
years without a unicheck program informing people of this fact.

cgf


Re: [Patch] cygcheck: warn about empty path-components

2004-10-06 Thread Bas van Gompel
Op Wed, 6 Oct 2004 11:49:39 +0200 schreef Corinna Vinschen
in <[EMAIL PROTECTED]>:
:  On Oct  6 10:49, Bas van Gompel wrote:
: > Op Tue, 5 Oct 2004 16:46:49 +0200 schreef Corinna Vinschen
: > in <[EMAIL PROTECTED]>:
: >
: > [Empty path-components resolving to current dir.]

[...]

: > Are you applying the patch?
:
:  I did, but I'm wondering if a check for relative paths wouldn't be
:  more useful.

I'll see if I can whip up something (trivial) in the not too far future.
(If noone beats me to it.)

BTW: Applying this (empty path-components) patch apparently caused some
TABs to be replaced by 8 spaces, somehow...

L8r,

Buzz.
-- 
  ) |  | ---/ ---/  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


Re: [Patch] cygcheck: warn about empty path-components

2004-10-06 Thread Bas van Gompel
Op Wed, 6 Oct 2004 10:58:05 -0400 schreef Christopher Faylor
in <[EMAIL PROTECTED]>:
:  On Wed, Oct 06, 2004 at 10:49:09AM +0200, Bas van Gompel wrote:

[Empty path-components resolving to current dir.]

: > (Maybe the message could get a ``-v'' addition like: ``This will
: > resolve to the current directory when in cygwin''.)

s/-v/-h/. (I'm waiting for the other (trailing slash) patch to be
applied or rejected, before submitting this.)

:  I see that Corinna has checked this in but I really don't see the need
:  for a warning for a perfectly acceptable use of an empty PATH component.
:
:  Why are we bothering with this?

If I may attempt to answer this one... Many people may not know of
this usage, yet may have their windows path ending on a ';'.

L8r,

Buzz.
-- 
  ) |  | ---/ ---/  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


Re: [Patch] cygcheck: warn about empty path-components

2004-10-06 Thread Christopher Faylor
On Wed, Oct 06, 2004 at 10:49:09AM +0200, Bas van Gompel wrote:
>Op Tue, 5 Oct 2004 16:46:49 +0200 schreef Corinna Vinschen
>in <[EMAIL PROTECTED]>:
>
>[Empty path-components resolving to current dir.]
>
>:  Oh, interesting.  I never even thought about using an empty path.
>
>Nor I. Thw described behaviour makes the warning even more useful (when
>cygcheck is run from a command/cmd prompt).
>
>Are you applying the patch?
>
>(Maybe the message could get a ``-v'' addition like: ``This will
>resolve to the current directory when in cygwin''.)

I see that Corinna has checked this in but I really don't see the need
for a warning for a perfectly acceptable use of an empty PATH component.

Why are we bothering with this?

cgf


Re: [Patch] cygcheck: warn about empty path-components

2004-10-06 Thread Corinna Vinschen
On Oct  6 10:49, Bas van Gompel wrote:
> Op Tue, 5 Oct 2004 16:46:49 +0200 schreef Corinna Vinschen
> in <[EMAIL PROTECTED]>:
> 
> [Empty path-components resolving to current dir.]
> 
> :  Oh, interesting.  I never even thought about using an empty path.
> 
> Nor I. Thw described behaviour makes the warning even more useful (when
> cygcheck is run from a command/cmd prompt).
> 
> Are you applying the patch?

I did, but I'm wondering if a check for relative paths wouldn't be
more useful.

Corinna

-- 
Corinna Vinschen  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader  mailto:[EMAIL PROTECTED]
Red Hat, Inc.


Re: [Patch] cygcheck: warn about empty path-components

2004-10-06 Thread Bas van Gompel
Op Tue, 5 Oct 2004 16:46:49 +0200 schreef Corinna Vinschen
in <[EMAIL PROTECTED]>:

[Empty path-components resolving to current dir.]

:  Oh, interesting.  I never even thought about using an empty path.

Nor I. Thw described behaviour makes the warning even more useful (when
cygcheck is run from a command/cmd prompt).

Are you applying the patch?

(Maybe the message could get a ``-v'' addition like: ``This will
resolve to the current directory when in cygwin''.)

L8r,
-- 
  ) |  | ---/ ---/  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^r


Re: [Patch] cygcheck: warn about empty path-components

2004-10-05 Thread Corinna Vinschen
On Oct  5 10:34, Christopher Faylor wrote:
> On Tue, Oct 05, 2004 at 09:09:31AM -0500, Brian Ford wrote:
> >The current directory is specified by a null path name, which can appear
> >immediately after the equal sign, between two colon delimiters anywhere in
> >the path list, or at the end of the path list.
> >[...]
> >I believe this is a valid construct and I have used it frequently.
> 
> Ditto.
> 
> PATH=/foo::/bar
> 
> means search for /foo, then the current directory, then /bar.

Oh, interesting.  I never even thought about using an empty path.

Corinna

-- 
Corinna Vinschen  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader  mailto:[EMAIL PROTECTED]
Red Hat, Inc.


Re: [Patch] cygcheck: warn about empty path-components

2004-10-05 Thread Christopher Faylor
On Tue, Oct 05, 2004 at 09:09:31AM -0500, Brian Ford wrote:
>On Tue, 5 Oct 2004, Corinna Vinschen wrote:
>
>> Chris, I might be missing something but that looks like a bug in
>> conv_path_list to me.  Why is conv_fn called with "." for empty
>> strings instead of ignoring the empty path?
>>
>> Is an empty path component a windowzism I don't know about?
>
>I don't know if it's part of any standard, but it's a *NIXism.  From
>Solaris 8 "man sh":
>
>Execution:
>
>The current directory is specified by a null path name, which can appear
>immediately after the equal sign, between two colon delimiters anywhere in
>the path list, or at the end of the path list.
>
>"man ksh"
>
>Execution:
>
>The default path is /bin:/usr/bin:  (specifying /bin, /usr/bin, and the
>current directory in that order).
>
>The current directory can be specified by two or more adjacent colons, or
>by a colon at the beginning or end of the path list.
>
>etc...
>
>I believe this is a valid construct and I have used it frequently.

Ditto.

PATH=/foo::/bar

means search for /foo, then the current directory, then /bar.

cgf


Re: [Patch] cygcheck: warn about empty path-components

2004-10-05 Thread Brian Ford
On Tue, 5 Oct 2004, Corinna Vinschen wrote:

> Chris, I might be missing something but that looks like a bug in
> conv_path_list to me.  Why is conv_fn called with "." for empty
> strings instead of ignoring the empty path?
>
> Is an empty path component a windowzism I don't know about?

I don't know if it's part of any standard, but it's a *NIXism.  From
Solaris 8 "man sh":

Execution:

The current directory is specified by a null path name, which can appear
immediately after the equal sign, between two colon delimiters anywhere in
the path list, or at the end of the path list.

"man ksh"

Execution:

The default path is /bin:/usr/bin:  (specifying /bin, /usr/bin, and the
current directory in that order).

The current directory can be specified by two or more adjacent colons, or
by a colon at the beginning or end of the path list.

etc...

I believe this is a valid construct and I have used it frequently.

-- 
Brian Ford
Senior Realtime Software Engineer
VITAL - Visual Simulation Systems
FlightSafety International
the best safety device in any aircraft is a well-trained pilot...


Re: [Patch] cygcheck: warn about empty path-components

2004-10-05 Thread Corinna Vinschen
On Oct  5 07:15, Bas van Gompel wrote:
> Hi,
> 
> This little patch makes cygcheck warn about empty path-components
> (leading/trailing/double ':'/';' in $PATH).
> 
> 
> ChangeLog-entry:
> 
> 2004-10-05  Bas van Gompel  <[EMAIL PROTECTED]>
> 
>   * cygcheck.cc (dump_sysinfo): Warn about empty path-components.

This looks ok, but it doesn't make much sense when started from a
Cygwin shell.  The reason is that empty paths are converted to "."
or ".\" respectively when converting between posix and win32 paths.

Chris, I might be missing something but that looks like a bug in
conv_path_list to me.  Why is conv_fn called with "." for empty
strings instead of ignoring the empty path?

Is an empty path component a windowzism I don't know about?


Corinna

-- 
Corinna Vinschen  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader  mailto:[EMAIL PROTECTED]
Red Hat, Inc.