On 9/22/2019 1:18 PM, Ken Brown wrote:
[...]
> @@ -354,6 +353,25 @@ rmdir (const char *dir)
>   
>     __try
>       {
> +      if (!*dir)
> +     {
> +       set_errno (ENOENT);
> +       __leave;
> +     }
> +
> +      /* Following Linux, do not resolve the last component of DIR if
> +      it is a symlink, even if DIR has a trailing slash.  Achieve
> +      this by stripping trailing slashes or backslashes.  */
> +      if (isdirsep (dir[strlen (dir) - 1]))
> +     {
> +       /* This converts // to /, but since both give ENOTEMPTY,
> +          we're okay.  */
> +       char *buf;
> +       char *p = stpcpy (buf = tp.c_get (), dir) - 1;

I forgot to declare tp.  v2 is on the way.

Ken

Reply via email to