bug-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: VMS: Fix explicit rules for VMS


From: Paul Smith
Subject: Re: VMS: Fix explicit rules for VMS
Date: Wed, 08 Oct 2014 00:43:12 -0400

Some of the same formatting notes as before; please check your code
against the style of the rest of the code.

It seems picky and I can clean these up myself afterwards, but I don't
know whether to do it in the same commit (which is weird since it will
have two authors) or in a followup commit (which is weird since it means
there will be a commit where the formatting is wrong).  If it's cleaned
up before submission I don't have to choose one weird over the
other :-p :-)


On Tue, 2014-10-07 at 21:06 -0500, John E. Malmberg wrote:
> +static char * downcase_inplace(char * filename)
> +{

This should be:

  static char *
  downcase_inplace (char *filename)
  {

Etc. for other function definitions.

> +      /* Todo: Why is this only needed on VMS? */
> +      {
> +          char * lname;
> +          lname = strdup(name);
> +          dir->name = strcache_add_len (downcase_inplace (lname), p - name);
> +          free(lname);
> +      }

I was confused about the strdup() here because strcache() doesn't need
it, until I noticed the downcase_inplace().  Also you should use
xstrdup().  I think it would be clearer to write:

      /* Todo: Why is this only needed on VMS? */
      {
          char *lname = downcase_inplace (xstrdup (name));
          dir->name = strcache_add_len (lname, p - name);
          free (lname);
      }

Regarding your question, I believe that the other platforms use
"case-insensitive but case-preserving", which is why they don't downcase
filenames (if I understand what's going on here).

> +      if (*slash == '/')
> +        {
> +          filename = p = slash + 1;
> +        }
> +      else
> +        {
> +          filename = p = slash;
> +        }

Should be just:

    if (*slash == '/')
      filename = p = slash + 1;
    else
      filename = p = slash;

And other places need similar changes.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]