nano-devel
[Top][All Lists]
Advanced

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

Re: [Nano-devel] Patch for bug #44950


From: Mike Frysinger
Subject: Re: [Nano-devel] Patch for bug #44950
Date: Tue, 19 Jan 2016 13:38:02 -0500

On 18 Jan 2016 11:50, Benno Schulenberg wrote:
> +    if (stat(parentdir, &parentinfo) != -1 && S_ISDIR(parentinfo.st_mode))
> +     valid_path = TRUE;
> +    else {
> +     statusbar(_("Directory '%s' does not exist"), parentdir);

this warning can be inaccurate/confusing.  the reason for stat() failure
is not always ENOENT, and it can hit here when it's not a dir.  maybe:
        valid_path = FALSE;
        if (stat(parentdir, &parentinfo) != -1) {
                statusbar(_("Directory '%s' failed: %s"), parentdir, 
strerror(errno));
                beep();
        } else if (!S_ISDIR(parentinfo.st_mode)) {
                statusbar(_("Path '%s' is not a directory"), parentdir);
                beep();
        } else
                valid_path = TRUE;
-mike

Attachment: signature.asc
Description: Digital signature


reply via email to

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