[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] directory separator
From: |
Paul Eggert |
Subject: |
Re: [PATCH] directory separator |
Date: |
Thu, 07 Jun 2012 00:29:03 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux i686; rv:12.0) Gecko/20120430 Thunderbird/12.0.1 |
On 06/07/2012 12:19 AM, John Darrington wrote:
> Surely using a symbol instead of a literal constant makes maintenance easier
> not
> harder?
I don't see why. For example:
remove ("a/b");
is simpler and easier to maintain than:
#if DIRECTORY_SEPARATOR == '/'
#define DIRECTORY_SEPARATOR_STRING "/"
#elif DIRECTORY_SEPARATOR == '\\'
#define DIRECTORY_SEPARATOR_STRING "\\"
#else
#error "Unknown DIRECTORY_SEPARATOR" DIRECTORY_SEPARATOR
#endif
remove ("a" DIRECTORY_SEPARATOR_STRING "b");