delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2000/08/24/01:46:04

Date: Thu, 24 Aug 2000 08:47:00 +0200
From: "Eli Zaretskii" <eliz AT is DOT elta DOT co DOT il>
Sender: halo1 AT zahav DOT net DOT il
To: lauras AT softhome DOT net
Message-Id: <7458-Thu24Aug2000084700+0300-eliz@is.elta.co.il>
X-Mailer: Emacs 20.6 (via feedmail 8.2.emacs20_6 I) and Blat ver 1.8.5b
CC: djgpp-workers AT delorie DOT com
In-reply-to: <39A3F0DA.B3A848DA@softhome.net> (message from Laurynas Biveinis
on Wed, 23 Aug 2000 17:42:18 +0200)
Subject: Re: Patch: __solve_dir_symlinks()
References: <39A3F0DA DOT B3A848DA AT softhome DOT net>
Reply-To: djgpp-workers AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp-workers AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

> Date: Wed, 23 Aug 2000 17:42:18 +0200
> From: Laurynas Biveinis <lauras AT softhome DOT net>
>
> +   last_part = basename(path_copy);
> +   if (*last_part == '\0')
> +   {
> +      /* If basename() returned pointer to the end of string, cut the last 
> +       * dir separator and try again.
> +       */ 
> +      *(last_part - 1) = '\0'; 
> +      last_part = basename(path_copy);
> +   }

What does this code produce when the argument is "c:/" or "c:"?

> +   printf("Running readlink() testsuite:\n");
> +   test_success( 1, "test1", "test1");
> +   test_success( 2, "test1/", "test1");
> +   test_success( 3, "dir1/test1", "dir1/test1");
> +   test_success( 4, "dirtest/file1", "dir1/file1");
> +   test_success( 5, "dirtest/test1", "dir1/test1");
> +   test_success( 6, "dirtest/test6/file", "dir1/dir2/file");
> +   printf("Done.\n");

My advice would be to always test DOS-style file names with drive
letters as well.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019