diff options
author | Christian Grothoff <christian@grothoff.org> | 2012-02-22 18:34:29 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2012-02-22 18:34:29 +0000 |
commit | e483ac2a2c8eab6d5cc915c2f54ab2c27c469821 (patch) | |
tree | 0cdd2d9b3cc4fc62b085fb2f71103a100313448e /src/fs/fs_dirmetascan.c | |
parent | 3a04f1fdf2882b96608e164babcd34dbcb2ad777 (diff) | |
download | gnunet-e483ac2a2c8eab6d5cc915c2f54ab2c27c469821.tar.gz gnunet-e483ac2a2c8eab6d5cc915c2f54ab2c27c469821.zip |
LRN: two directory patches change the way "is_directory" is evaluated.
Now it must be GNUNET_YES for the execution flow to switch to a branch
where something is considered to be a directory.
The reason for that is that some functions might return GNUNET_SYSERR
when asked whether something is a directory or not. Checking this
value as "!= GNUNET_NO" will produce positive result, even though it's
not a directory.
Diffstat (limited to 'src/fs/fs_dirmetascan.c')
-rw-r--r-- | src/fs/fs_dirmetascan.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/fs/fs_dirmetascan.c b/src/fs/fs_dirmetascan.c index 0b8b088c4..4e5354e80 100644 --- a/src/fs/fs_dirmetascan.c +++ b/src/fs/fs_dirmetascan.c | |||
@@ -152,7 +152,7 @@ advance (struct GNUNET_FS_ShareTreeItem *pos) | |||
152 | 152 | ||
153 | GNUNET_assert (NULL != pos); | 153 | GNUNET_assert (NULL != pos); |
154 | moved = 0; /* must not terminate, even on file, otherwise "normal" */ | 154 | moved = 0; /* must not terminate, even on file, otherwise "normal" */ |
155 | while ( (pos->is_directory) || | 155 | while ( (pos->is_directory == GNUNET_YES) || |
156 | (0 == moved) ) | 156 | (0 == moved) ) |
157 | { | 157 | { |
158 | if ( (moved != -1) && | 158 | if ( (moved != -1) && |
@@ -203,7 +203,7 @@ expand_tree (struct GNUNET_FS_ShareTreeItem *parent, | |||
203 | GNUNET_asprintf (&chld->short_filename, | 203 | GNUNET_asprintf (&chld->short_filename, |
204 | "%s%s", | 204 | "%s%s", |
205 | GNUNET_STRINGS_get_short_name (filename), | 205 | GNUNET_STRINGS_get_short_name (filename), |
206 | is_directory ? "/" : ""); | 206 | is_directory == GNUNET_YES ? "/" : ""); |
207 | /* make sure we do not end with '//' */ | 207 | /* make sure we do not end with '//' */ |
208 | slen = strlen (chld->short_filename); | 208 | slen = strlen (chld->short_filename); |
209 | if ( (slen >= 2) && | 209 | if ( (slen >= 2) && |
@@ -325,7 +325,7 @@ process_helper_msgs (void *cls, | |||
325 | NULL, GNUNET_SYSERR, | 325 | NULL, GNUNET_SYSERR, |
326 | GNUNET_FS_DIRSCANNER_ALL_COUNTED); | 326 | GNUNET_FS_DIRSCANNER_ALL_COUNTED); |
327 | ds->pos = ds->toplevel; | 327 | ds->pos = ds->toplevel; |
328 | if (ds->pos->is_directory) | 328 | if (ds->pos->is_directory == GNUNET_YES) |
329 | ds->pos = advance (ds->pos); | 329 | ds->pos = advance (ds->pos); |
330 | return; | 330 | return; |
331 | case GNUNET_MESSAGE_TYPE_FS_PUBLISH_HELPER_META_DATA: | 331 | case GNUNET_MESSAGE_TYPE_FS_PUBLISH_HELPER_META_DATA: |