diff options
author | Frederic Culot <calcurse@culot.org> | 2007-01-16 07:55:18 +0000 |
---|---|---|
committer | Frederic Culot <calcurse@culot.org> | 2007-01-16 07:55:18 +0000 |
commit | efc51ae38c7d05cd1372d2ef40f49e601c129647 (patch) | |
tree | 0b65a3d1aa7ff99704b1237d29d6fa0fff6bf41b /src/utils.c | |
parent | 89811b56e2e66960d91faab2db850d91f80f68e3 (diff) | |
download | calcurse-efc51ae38c7d05cd1372d2ef40f49e601c129647.zip |
better handling of the values returned by getstring()
Diffstat (limited to 'src/utils.c')
-rwxr-xr-x | src/utils.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/utils.c b/src/utils.c index 677a9a8..d475b8f 100755 --- a/src/utils.c +++ b/src/utils.c @@ -1,8 +1,8 @@ -/* $calcurse: utils.c,v 1.20 2006/12/18 09:30:28 culot Exp $ */ +/* $calcurse: utils.c,v 1.21 2007/01/16 07:55:18 culot Exp $ */ /* * Calcurse - text-based organizer - * Copyright (c) 2004-2006 Frederic Culot + * Copyright (c) 2004-2007 Frederic Culot * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -245,7 +245,7 @@ int getstring(WINDOW *win, int colr, char *str, int l, int x, int y) break; case ESCAPE: /* cancel editing */ - return 1; + return GETSTRING_ESC; break; default: /* insert one character */ @@ -263,7 +263,7 @@ int getstring(WINDOW *win, int colr, char *str, int l, int x, int y) } *str = 0; custom_remove_attr(win, ATTR_HIGHEST); - return 0; + return (len == 0 ? GETSTRING_RET : GETSTRING_VALID); } /* Update an already existing string. */ |