public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Ken Brown <kbrown@cornell.edu>
To: cygwin@cygwin.com
Subject: Re: Fonts reorganization and additions
Date: Mon, 14 Sep 2015 17:40:00 -0000	[thread overview]
Message-ID: <55F7068D.4080706@cornell.edu> (raw)
In-Reply-To: <55F5A008.80308@cornell.edu>

On 9/13/2015 12:10 PM, Ken Brown wrote:
> On 9/11/2015 3:59 PM, Yaakov Selkowitz wrote:
>> The first thing that should be checked is if the code in setup which
>> allows it to unpack files with "illegal" characters in Windows also
>> makes sure to create parent directories.  Based on these reports my
>> *guess* is it doesn't but I haven't looked yet.
>
> I'm not very familiar with the setup code, but I think I may have found
> the problem.  The function mkdir_p() in mkdir.cc contains the following,
> starting at line 99:
>
>    for (c = path; *c; c++)
>      {
>        if (*c == ':')
>      slash = 0;
>        if (*c == '/' || *c == '\\')
>      slash = c;
>      }
>
>    if (!slash)
>      return 0;
>
> If I understand this correctly, the function will return success without
> having created the leading directory if the path name contains a colon
> and doesn't contain a slash after the last colon.  I guess the
> assumption is that there is no "leading directory" to be created in this
> case.  [This part of the code was written in 2000, when a colon could
> not be part of a file name.]
>
> I hope someone who understands the setup code better than I do can take
> a look at this.  I'm not confident that I understand all the uses of
> mkdir_p() or all possible reasons why its in_path argument might contain
> a colon.

The following patch fixes the problem:

diff --git a/mkdir.cc b/mkdir.cc
index dabc256..84bb176 100644
--- a/mkdir.cc
+++ b/mkdir.cc
@@ -98,8 +98,6 @@ mkdir_p (int isadir, const char *in_path, mode_t mode)

    for (c = path; *c; c++)
      {
-      if (*c == ':')
-       slash = 0;
        if (*c == '/' || *c == '\\')
         slash = c;
      }

I don't know if this might cause some other problem, but it seems OK in 
limited testing.

Ken


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

  reply	other threads:[~2015-09-14 17:40 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1441962346.9784.34.camel@cygwin.com>
2015-09-11 11:21 ` Ola Strömfors
2015-09-11 16:29   ` Ken Brown
2015-09-11 16:39     ` Yaakov Selkowitz
2015-09-11 17:50       ` Nem W Schlecht
2015-09-11 19:12       ` Ken Brown
2015-09-11 19:59         ` Yaakov Selkowitz
2015-09-11 21:36           ` Ken Brown
2015-09-12 15:36             ` Jim Reisert AD1C
2015-09-13 16:10           ` Ken Brown
2015-09-14 17:40             ` Ken Brown [this message]
2015-09-14 20:55               ` Ken Brown
2015-09-12 16:33 Fergus
2015-09-12 21:59 ` Ken Brown
2015-09-13  7:02 ` Fergus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=55F7068D.4080706@cornell.edu \
    --to=kbrown@cornell.edu \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).