… | |
… | |
352 | struct file_wordexp *wexp; |
352 | struct file_wordexp *wexp; |
353 | int len,is_pipe=0; |
353 | int len,is_pipe=0; |
354 | char *wdata; |
354 | char *wdata; |
355 | char **wexp_data; |
355 | char **wexp_data; |
356 | if (! data) |
356 | if (! data) |
|
|
357 | { |
357 | return NULL; |
358 | return NULL; |
|
|
359 | } |
|
|
360 | |
358 | dbg(1,"map_new_textfile %s\n", data->u.str); |
361 | // ** dbg(1,"map_new_textfile %s\n", data->u.str); |
|
|
362 | |
359 | wdata=g_strdup(data->u.str); |
363 | //wdata=g_strdup(data->u.str); |
360 | len=strlen(wdata); |
364 | //len=strlen(wdata); |
361 | if (len && wdata[len-1] == '|') { |
365 | //if (len && wdata[len-1] == '|') { |
362 | wdata[len-1]='\0'; |
366 | // wdata[len-1]='\0'; |
363 | is_pipe=1; |
367 | // is_pipe=1; |
364 | } |
368 | //} |
365 | wexp=file_wordexp_new(wdata); |
369 | //wexp=file_wordexp_new(wdata); |
366 | wexp_data=file_wordexp_get_array(wexp); |
370 | //wexp_data=file_wordexp_get_array(wexp); |
367 | *meth=map_methods_textfile; |
371 | *meth=map_methods_textfile; |
368 | |
372 | |
369 | m=g_new0(struct map_priv, 1); |
373 | m=g_new0(struct map_priv, 1); |
370 | m->id=++map_id; |
374 | m->id=++map_id; |
371 | m->filename=g_strdup(wexp_data[0]); |
375 | m->filename=g_strdup(data->u.str); |
372 | m->is_pipe=is_pipe; |
376 | m->is_pipe=is_pipe; |
373 | if (flags) |
377 | if (flags) |
|
|
378 | { |
374 | m->flags=flags->u.num; |
379 | m->flags=flags->u.num; |
|
|
380 | } |
375 | dbg(1,"map_new_textfile %s %s\n", m->filename, wdata); |
381 | // dbg(1,"map_new_textfile %s %s\n", m->filename, wdata); |
376 | if (charset) { |
382 | if (charset) |
|
|
383 | { |
377 | m->charset=g_strdup(charset->u.str); |
384 | m->charset=g_strdup(charset->u.str); |
378 | meth->charset=m->charset; |
385 | meth->charset=m->charset; |
379 | } |
386 | } |
380 | file_wordexp_destroy(wexp); |
387 | //file_wordexp_destroy(wexp); |
381 | g_free(wdata); |
388 | //g_free(wdata); |
382 | return m; |
389 | return m; |
383 | } |
390 | } |
384 | |
391 | |
385 | void |
392 | void |
386 | plugin_init(void) |
393 | plugin_init(void) |