Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2013-03-05 11:36:30 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-03-05 11:36:30 +0400
commit02caa057641218fef2bcc168719ac08c86f55505 (patch)
tree4d267832bbccbd67df1a3f7f159862759ad40510 /source/blender/blenlib/intern/storage.c
parent47c47ef7a2791840b4c6f8c3b7c76092009923ef (diff)
code cleanup: remove unused argument from bli_builddir
Diffstat (limited to 'source/blender/blenlib/intern/storage.c')
-rw-r--r--source/blender/blenlib/intern/storage.c33
1 files changed, 9 insertions, 24 deletions
diff --git a/source/blender/blenlib/intern/storage.c b/source/blender/blenlib/intern/storage.c
index 12d9d4a174f..c65123d39a4 100644
--- a/source/blender/blenlib/intern/storage.c
+++ b/source/blender/blenlib/intern/storage.c
@@ -215,11 +215,8 @@ struct BuildDirCtx {
/**
* Scans the directory named *dirname and appends entries for its contents to files.
- * Recorded pathnames will be prefixed by *relname if specified (FIXME: actually this
- * option is not used anywhere, might as well get rid of it).
*/
-static void bli_builddir(const char *dirname, const char *relname,
- struct BuildDirCtx *dir_ctx)
+static void bli_builddir(struct BuildDirCtx *dir_ctx, const char *dirname)
{
struct ListBase dirbase = {NULL, NULL};
int newnum = 0;
@@ -227,25 +224,13 @@ static void bli_builddir(const char *dirname, const char *relname,
if ((dir = opendir(dirname)) != NULL) {
- {
- const struct dirent *fname;
- int rellen;
- char buf[PATH_MAX];
- BLI_strncpy(buf, relname, sizeof(buf));
- rellen = strlen(relname);
-
- if (rellen) {
- buf[rellen] = '/';
- rellen++;
- }
- while ((fname = readdir(dir)) != NULL) {
- struct dirlink * const dlink = (struct dirlink *)malloc(sizeof(struct dirlink));
- if (dlink != NULL) {
- BLI_strncpy(buf + rellen, fname->d_name, sizeof(buf) - rellen);
- dlink->name = BLI_strdup(buf);
- BLI_addhead(&dirbase, dlink);
- newnum++;
- }
+ const struct dirent *fname;
+ while ((fname = readdir(dir)) != NULL) {
+ struct dirlink * const dlink = (struct dirlink *)malloc(sizeof(struct dirlink));
+ if (dlink != NULL) {
+ dlink->name = BLI_strdup(fname->d_name);
+ BLI_addhead(&dirbase, dlink);
+ newnum++;
}
}
@@ -449,7 +434,7 @@ unsigned int BLI_dir_contents(const char *dirname, struct direntry **filelist)
dir_ctx.nrfiles = 0;
dir_ctx.files = NULL;
- bli_builddir(dirname, "", &dir_ctx);
+ bli_builddir(&dir_ctx, dirname);
bli_adddirstrings(&dir_ctx);
if (dir_ctx.files) {