Changeset 010a951 for commands.c
- Timestamp:
- Mar 5, 2011, 3:25:29 PM (14 years ago)
- Branches:
- master, release-1.10, release-1.8, release-1.9
- Children:
- e3a75ed
- Parents:
- 9620c8d
- git-author:
- David Benjamin <davidben@mit.edu> (02/28/11 10:53:18)
- git-committer:
- David Benjamin <davidben@mit.edu> (03/05/11 15:25:29)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
commands.c
r259e0475 r010a951 1614 1614 { 1615 1615 const char *var; 1616 char valbuff[1024];1616 char *value; 1617 1617 1618 1618 if (argc==1) { … … 1626 1626 var=argv[1]; 1627 1627 1628 if (0 == owl_variable_get_tostring(owl_global_get_vardict(&g), 1629 var, valbuff, 1024)) { 1630 owl_function_makemsg("%s = '%s'", var, valbuff); 1628 value = owl_variable_get_tostring(owl_global_get_vardict(&g), var); 1629 if (value) { 1630 owl_function_makemsg("%s = '%s'", var, value); 1631 g_free(value); 1631 1632 } else { 1632 1633 owl_function_makemsg("Unknown variable '%s'.", var); … … 2507 2508 char *owl_command_getvar(int argc, const char *const *argv, const char *buff) 2508 2509 { 2509 char tmpbuff[1024];2510 2510 if (argc != 2) { 2511 2511 owl_function_makemsg("Wrong number of arguments for %s", argv[0]); 2512 2512 return NULL; 2513 2513 } 2514 if (owl_variable_get_tostring(owl_global_get_vardict(&g), 2515 argv[1], tmpbuff, 1024)) { 2516 return NULL; 2517 } 2518 return g_strdup(tmpbuff); 2514 return owl_variable_get_tostring(owl_global_get_vardict(&g), argv[1]); 2519 2515 } 2520 2516
Note: See TracChangeset
for help on using the changeset viewer.