From efc51ae38c7d05cd1372d2ef40f49e601c129647 Mon Sep 17 00:00:00 2001 From: Frederic Culot Date: Tue, 16 Jan 2007 07:55:18 +0000 Subject: better handling of the values returned by getstring() --- src/utils.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/utils.c') 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. */ -- cgit v1.2.3-54-g00ecf