NULL pointer clarification in Swig_new_subdirectory

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@13897 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
William S Fulton 2012-11-16 19:39:50 +00:00
commit b107f57e59

View file

@ -167,16 +167,16 @@ static int is_directory(String *directory) {
* Swig_new_subdirectory()
*
* Create the subdirectory only if the basedirectory already exists as a directory.
* basedirectory can be NULL or empty to indicate current directory.
* basedirectory can be empty to indicate current directory but not NULL.
* ----------------------------------------------------------------------------- */
String *Swig_new_subdirectory(String *basedirectory, String *subdirectory) {
String *error = 0;
int current_directory = basedirectory ? (Len(basedirectory) == 0 ? 1 : 0) : 0;
int current_directory = Len(basedirectory) == 0;
if (current_directory || is_directory(basedirectory)) {
Iterator it;
String *dir = basedirectory ? NewString(basedirectory) : NewString("");
String *dir = NewString(basedirectory);
List *subdirs = Split(subdirectory, SWIG_FILE_DELIMITER[0], INT_MAX);
for (it = First(subdirs); it.item; it = Next(it)) {