Marcos Cruz <[email protected]> wrote:
> En/Je/On 2013-05-10 21:58, Hannes Schüller escribió / skribis /
> wrote :
>
> > Works for me. Can you quote *exactly* the lines you have in your
> > config files which don't work?
>
> map :qpl=:open http://localhost/programandala.net
> map :qp=:open http://programandala.net
> map :qvl=:open http://localhost/vivirenbicicleta.info
> map :qv=:open http://vivirenbicicleta.info
>
> Those are the first maps of this kind I've tried (I mean, mappings
> that start with a semicolon and create a command).
>
> I've just realized something new: only the last mapping in the list
> works, whatever it is. The rest of the maps cause the error "Not a
> browser command".
Ah, I can see the problem now! Mapping multiple colon commands to other
colon commands, the memory storing the new alias is always
overwritten, so only the last one is correctly stored. Could you try the
attached patch and see if it solves your problem?
Hannes
diff --git a/utilities.c b/utilities.c
index b414e3d..4a11912 100644
--- a/utilities.c
+++ b/utilities.c
@@ -315,7 +315,9 @@ process_colon(char *alias, char *cmd) {
fprintf(stderr, "Memory exhausted while saving new command.\n");
exit(EXIT_FAILURE);
}
- a->alias = ++alias;
+ a->alias = malloc(strlen(alias)*sizeof(char));
+ memset(a->alias, 0, strlen(alias));
+ strncpy(a->alias, (alias + 1), strlen(alias) - 1);
a->target = cmd;
colon_aliases = g_list_prepend(colon_aliases, a);
return TRUE;
------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and
their applications. This 200-page book is written by three acclaimed
leaders in the field. The early access version is available now.
Download your free book today! http://p.sf.net/sfu/neotech_d2d_may
_______________________________________________
Vimprobable-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/vimprobable-users