~baltix/libbdplus/trunk

« back to all changes in this revision

Viewing changes to src/file/dirs_darwin.c

  • Committer: anonymous
  • Date: 2017-03-03 13:09:11 UTC
  • Revision ID: git-v1:e89c271fe1b353b93ae09b8fb5646c24f6b57215
Merge changes from other libs

Show diffs side-by-side

added added

removed removed

Lines of Context:
73
73
 
74
74
const char *file_get_config_system(const char *dir)
75
75
{
76
 
    static char *dirs = NULL; // "dir1\0dir2\0...\0dirN\0\0"
77
 
 
78
 
    if (!dirs) {
79
 
        dirs = str_printf("%s%c%c", SYSTEM_CFG_DIR, 0, 0);
80
 
    }
81
 
 
82
76
    if (!dir) {
83
77
        // first call
84
 
        dir = dirs;
85
 
    } else {
86
 
        // next call
87
 
        dir += strlen(dir) + 1;
88
 
        if (!*dir) {
89
 
            // end of list
90
 
            dir = NULL;
91
 
        }
 
78
        return SYSTEM_CFG_DIR;
92
79
    }
93
80
 
94
 
    return dir;
 
81
    return NULL;
95
82
}