diff options
author | Christian Grothoff <christian@grothoff.org> | 2010-10-26 10:58:11 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2010-10-26 10:58:11 +0000 |
commit | ccc760fc1da9b3f377a445f43474633f20f4de67 (patch) | |
tree | 0ac0cb7bafd6681477c0841dc9f687e37ea626a6 /src | |
parent | 7be0d997e770cb7005e5fbb4e56ee7fa7495bde4 (diff) | |
download | gnunet-ccc760fc1da9b3f377a445f43474633f20f4de67.tar.gz gnunet-ccc760fc1da9b3f377a445f43474633f20f4de67.zip |
fixes
Diffstat (limited to 'src')
-rw-r--r-- | src/fs/fs_file_information.c | 1 | ||||
-rw-r--r-- | src/fs/fs_uri.c | 24 |
2 files changed, 13 insertions, 12 deletions
diff --git a/src/fs/fs_file_information.c b/src/fs/fs_file_information.c index b9b5928db..c91dbd530 100644 --- a/src/fs/fs_file_information.c +++ b/src/fs/fs_file_information.c | |||
@@ -24,7 +24,6 @@ | |||
24 | * @author Christian Grothoff | 24 | * @author Christian Grothoff |
25 | * | 25 | * |
26 | * TODO: | 26 | * TODO: |
27 | * - serialization/deserialization (& deserialization API) | ||
28 | * - metadata filename clean up code | 27 | * - metadata filename clean up code |
29 | * - metadata/ksk generation for directories from contained files | 28 | * - metadata/ksk generation for directories from contained files |
30 | */ | 29 | */ |
diff --git a/src/fs/fs_uri.c b/src/fs/fs_uri.c index 7d0321464..9a4f72201 100644 --- a/src/fs/fs_uri.c +++ b/src/fs/fs_uri.c | |||
@@ -960,7 +960,6 @@ canonicalize_keyword (const char *in) | |||
960 | case '\n': | 960 | case '\n': |
961 | case '\r': | 961 | case '\r': |
962 | /* skip characters listed above */ | 962 | /* skip characters listed above */ |
963 | rpos++; | ||
964 | break; | 963 | break; |
965 | case 'b': | 964 | case 'b': |
966 | case 'c': | 965 | case 'c': |
@@ -985,6 +984,7 @@ canonicalize_keyword (const char *in) | |||
985 | /* convert characters listed above to lower case */ | 984 | /* convert characters listed above to lower case */ |
986 | *wpos = tolower( (unsigned char)*rpos); | 985 | *wpos = tolower( (unsigned char)*rpos); |
987 | wpos++; | 986 | wpos++; |
987 | break; | ||
988 | case '!': | 988 | case '!': |
989 | case '.': | 989 | case '.': |
990 | case '?': | 990 | case '?': |
@@ -997,6 +997,7 @@ canonicalize_keyword (const char *in) | |||
997 | /* replace characters listed above with '_' */ | 997 | /* replace characters listed above with '_' */ |
998 | *wpos = '_'; | 998 | *wpos = '_'; |
999 | wpos++; | 999 | wpos++; |
1000 | break; | ||
1000 | } | 1001 | } |
1001 | rpos++; | 1002 | rpos++; |
1002 | } | 1003 | } |
@@ -1564,9 +1565,9 @@ gather_uri_data (void *cls, | |||
1564 | for (j = uri->data.ksk.keywordCount - 1; j >= 0; j--) | 1565 | for (j = uri->data.ksk.keywordCount - 1; j >= 0; j--) |
1565 | if (0 == strcmp (&uri->data.ksk.keywords[j][1], data)) | 1566 | if (0 == strcmp (&uri->data.ksk.keywords[j][1], data)) |
1566 | return GNUNET_OK; | 1567 | return GNUNET_OK; |
1567 | nkword = GNUNET_malloc (strlen (data) + 2); | 1568 | GNUNET_asprintf (&nkword, |
1568 | strcpy (nkword, " "); /* not mandatory */ | 1569 | " %s", /* space to mark as 'non mandatory' */ |
1569 | strcat (nkword, data); | 1570 | data); |
1570 | uri->data.ksk.keywords[uri->data.ksk.keywordCount++] = nkword; | 1571 | uri->data.ksk.keywords[uri->data.ksk.keywordCount++] = nkword; |
1571 | return 0; | 1572 | return 0; |
1572 | } | 1573 | } |
@@ -1584,19 +1585,20 @@ struct GNUNET_FS_Uri * | |||
1584 | GNUNET_FS_uri_ksk_create_from_meta_data (const struct GNUNET_CONTAINER_MetaData *md) | 1585 | GNUNET_FS_uri_ksk_create_from_meta_data (const struct GNUNET_CONTAINER_MetaData *md) |
1585 | { | 1586 | { |
1586 | struct GNUNET_FS_Uri *ret; | 1587 | struct GNUNET_FS_Uri *ret; |
1588 | int ent; | ||
1587 | 1589 | ||
1588 | if (md == NULL) | 1590 | if (md == NULL) |
1589 | return NULL; | 1591 | return NULL; |
1590 | ret = GNUNET_malloc (sizeof (struct GNUNET_FS_Uri)); | 1592 | ret = GNUNET_malloc (sizeof (struct GNUNET_FS_Uri)); |
1591 | ret->type = ksk; | 1593 | ret->type = ksk; |
1592 | ret->data.ksk.keywordCount = 0; | 1594 | ent = GNUNET_CONTAINER_meta_data_iterate (md, NULL, NULL); |
1593 | ret->data.ksk.keywords = NULL; | 1595 | if (ent > 0) |
1594 | ret->data.ksk.keywords | 1596 | { |
1595 | = GNUNET_malloc (sizeof (char *) * | 1597 | ret->data.ksk.keywords |
1596 | GNUNET_CONTAINER_meta_data_iterate (md, NULL, NULL)); | 1598 | = GNUNET_malloc (sizeof (char *) * ent); |
1597 | GNUNET_CONTAINER_meta_data_iterate (md, &gather_uri_data, ret); | 1599 | GNUNET_CONTAINER_meta_data_iterate (md, &gather_uri_data, ret); |
1600 | } | ||
1598 | return ret; | 1601 | return ret; |
1599 | |||
1600 | } | 1602 | } |
1601 | 1603 | ||
1602 | 1604 | ||