aboutsummaryrefslogtreecommitdiff
path: root/src/fs/gnunet-fs-gtk_common.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/fs/gnunet-fs-gtk_common.c')
-rw-r--r--src/fs/gnunet-fs-gtk_common.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/fs/gnunet-fs-gtk_common.c b/src/fs/gnunet-fs-gtk_common.c
index 91858455..8ca006e3 100644
--- a/src/fs/gnunet-fs-gtk_common.c
+++ b/src/fs/gnunet-fs-gtk_common.c
@@ -253,10 +253,13 @@ GNUNET_FS_GTK_mmap_and_scan (const char *filename,
253 * the respective meta data. 253 * the respective meta data.
254 * 254 *
255 * @param meta meta data to inspect 255 * @param meta meta data to inspect
256 * @param is_a_dup is set to GNUNET_YES if the result is a dup, and there was
257 * no description to be found. GNUNET_NO otherwise.
256 * @return description of the result in utf-8, never NULL 258 * @return description of the result in utf-8, never NULL
257 */ 259 */
258char * 260char *
259GNUNET_FS_GTK_get_description_from_metadata (const struct GNUNET_CONTAINER_MetaData *meta) 261GNUNET_FS_GTK_get_description_from_metadata (
262 const struct GNUNET_CONTAINER_MetaData *meta, int *is_a_dup)
260{ 263{
261 char *desc; 264 char *desc;
262 char *utf8_desc; 265 char *utf8_desc;
@@ -276,13 +279,20 @@ GNUNET_FS_GTK_get_description_from_metadata (const struct GNUNET_CONTAINER_MetaD
276 EXTRACTOR_METATYPE_KEYWORDS, 279 EXTRACTOR_METATYPE_KEYWORDS,
277 -1); 280 -1);
278 if (desc == NULL) 281 if (desc == NULL)
282 {
283 *is_a_dup = GNUNET_YES;
279 return GNUNET_strdup (_("no description supplied")); 284 return GNUNET_strdup (_("no description supplied"));
285 }
280 utf8_desc = 286 utf8_desc =
281 GNUNET_FS_GTK_dubious_meta_to_utf8 (EXTRACTOR_METAFORMAT_UTF8, desc, 287 GNUNET_FS_GTK_dubious_meta_to_utf8 (EXTRACTOR_METAFORMAT_UTF8, desc,
282 strlen (desc) + 1); 288 strlen (desc) + 1);
283 GNUNET_free (desc); 289 GNUNET_free (desc);
284 if (utf8_desc == NULL) 290 if (utf8_desc == NULL)
291 {
292 *is_a_dup = GNUNET_YES;
285 return GNUNET_strdup (_("no description supplied")); 293 return GNUNET_strdup (_("no description supplied"));
294 }
295 *is_a_dup = GNUNET_NO;
286 return utf8_desc; 296 return utf8_desc;
287} 297}
288 298