X-Git-Url: https://secure.softndesign.org/git/?a=blobdiff_plain;f=program.c;h=a178018330096877d930622067f2f2d3427af1bb;hb=0e1e4e76ddae605f4d587bb7097f7bd86aa6ef16;hp=70ce6c12f943cc5519ba1b2e74d73843d264c5f7;hpb=bdcb95da42ef20e0385e0c0404cb25844c3bb137;p=calc.git diff --git a/program.c b/program.c index 70ce6c1..a178018 100644 --- a/program.c +++ b/program.c @@ -141,6 +141,7 @@ void list () void edit (int id) { + extern char *edit_line; int n = lookfor_program (id); if (n == -1) { VERBOSE (WARNING, fprintf (stdout, "error unknown program (%d)\n", id)); @@ -148,7 +149,11 @@ void edit (int id) } /* set string program */ - fprintf (stdout, "edit: %s\n", programs[n]->string); + if (edit_line) { + free (edit_line); + } + edit_line = strdup (programs[n]->string); + //fprintf (stdout, "edit: %s\n", programs[n]->string); } void savestring (int id, char *string)