aboutsummaryrefslogtreecommitdiff
path: root/src/fs/fs_getopt.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/fs/fs_getopt.c')
-rw-r--r--src/fs/fs_getopt.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/fs/fs_getopt.c b/src/fs/fs_getopt.c
index d2ee34a94..86fc9578c 100644
--- a/src/fs/fs_getopt.c
+++ b/src/fs/fs_getopt.c
@@ -118,17 +118,20 @@ GNUNET_FS_getopt_set_keywords (struct GNUNET_GETOPT_CommandLineProcessorContext
118 * @param scls must be of type "struct GNUNET_MetaData **" 118 * @param scls must be of type "struct GNUNET_MetaData **"
119 * @param option name of the option (typically 'k') 119 * @param option name of the option (typically 'k')
120 * @param value command line argument given 120 * @param value command line argument given
121 * @return GNUNET_OK on success 121 * @return #GNUNET_OK on success
122 */ 122 */
123int 123int
124GNUNET_FS_getopt_set_metadata (struct GNUNET_GETOPT_CommandLineProcessorContext 124GNUNET_FS_getopt_set_metadata (struct GNUNET_GETOPT_CommandLineProcessorContext *ctx,
125 *ctx, void *scls, const char *option, 125 void *scls,
126 const char *option,
126 const char *value) 127 const char *value)
127{ 128{
128 struct GNUNET_CONTAINER_MetaData **mm = scls; 129 struct GNUNET_CONTAINER_MetaData **mm = scls;
130#if HAVE_EXTRACTOR_H
129 enum EXTRACTOR_MetaType type; 131 enum EXTRACTOR_MetaType type;
130 const char *typename; 132 const char *typename;
131 const char *typename_i18n; 133 const char *typename_i18n;
134#endif
132 struct GNUNET_CONTAINER_MetaData *meta; 135 struct GNUNET_CONTAINER_MetaData *meta;
133 char *tmp; 136 char *tmp;
134 137
@@ -144,7 +147,7 @@ GNUNET_FS_getopt_set_metadata (struct GNUNET_GETOPT_CommandLineProcessorContext
144 */ 147 */
145 /*tmp = GNUNET_STRINGS_to_utf8 (value, strlen (value), locale_charset ());*/ 148 /*tmp = GNUNET_STRINGS_to_utf8 (value, strlen (value), locale_charset ());*/
146 tmp = GNUNET_strdup (value); 149 tmp = GNUNET_strdup (value);
147 150#if HAVE_EXTRACTOR_H
148 type = EXTRACTOR_metatype_get_max (); 151 type = EXTRACTOR_metatype_get_max ();
149 while (type > 0) 152 while (type > 0)
150 { 153 {
@@ -181,7 +184,9 @@ GNUNET_FS_getopt_set_metadata (struct GNUNET_GETOPT_CommandLineProcessorContext
181 break; 184 break;
182 } 185 }
183 } 186 }
184 if (tmp != NULL) 187#endif
188
189 if (NULL != tmp)
185 { 190 {
186 GNUNET_CONTAINER_meta_data_insert (meta, "<gnunet>", 191 GNUNET_CONTAINER_meta_data_insert (meta, "<gnunet>",
187 EXTRACTOR_METATYPE_UNKNOWN, 192 EXTRACTOR_METATYPE_UNKNOWN,