From: David Lawrence Ramsey Date: Sun, 5 Jun 2005 23:12:18 +0000 (+0000) Subject: make parse_line_column() more consistent: don't return an error on X-Git-Tag: v1.3.8~207 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=f99acbf29afa3386c1bb04eec1008490d2474d31;p=nano.git make parse_line_column() more consistent: don't return an error on strings like "3," since we don't return one on strings like ",3" git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2596 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- diff --git a/src/utils.c b/src/utils.c index 350ccccd..494243b6 100644 --- a/src/utils.c +++ b/src/utils.c @@ -118,7 +118,9 @@ bool parse_line_column(const char *str, int *line, ssize_t *column) comma = strchr(str, ','); if (comma != NULL && column != NULL) { - if (!parse_num(&str[comma - str + 1], column)) + const char *str_line = str + (comma - str + 1); + + if (str_line[0] != '\0' && !parse_num(str_line, column)) retval = FALSE; }