Mailing List Archive

[Bug 749] Regression: whitespace should compare numerically equal to zero
------- You are receiving this mail because: -------
You are on the CC list for the bug.

http://bugs.exim.org/show_bug.cgi?id=749




--- Comment #1 from Phil Pennock <exim-dev@spodhuis.org> 2008-08-17 04:23:10 ---
Created an attachment (id=265)
--> (http://bugs.exim.org/attachment.cgi?id=265)
Treat a string consisting only of spaces as numerically zero

This treats any string consisting only of spaces as numerically equal to 0 in
any context where a number is explicitly extracted; I chose to put the test
inside expand_string_integer() instead of in the numeric comparison checks.

The only other callers of expand_string_integer pass it message_size_limit
(global or transport) which should have already been confirmed to be numerical,
so I think this is safe. The empty-string check which PH added was in the
numeric comparison checks but that avoids trying to expand empty strings etc
and makes sense.

So I think this is good but will understand if it's a wrong call. The workload
is tiny, if someone else wants to move the check. ;)


--
Configure bugmail: http://bugs.exim.org/userprefs.cgi?tab=email

--
## List details at http://lists.exim.org/mailman/listinfo/exim-dev Exim details at http://www.exim.org/ ##
[Bug 749] Regression: whitespace should compare numerically equal to zero [ In reply to ]
------- You are receiving this mail because: -------
You are on the CC list for the bug.

http://bugs.exim.org/show_bug.cgi?id=749

Tony Finch <dot@dotat.at> changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |dot@dotat.at




--- Comment #2 from Tony Finch <dot@dotat.at> 2008-08-18 14:56:17 ---
Thanks for the bug report and patch. Shouldn't the fix for whitespace-only
strings be performed in expand_string_integer()?


--
Configure bugmail: http://bugs.exim.org/userprefs.cgi?tab=email

--
## List details at http://lists.exim.org/mailman/listinfo/exim-dev Exim details at http://www.exim.org/ ##
[Bug 749] Regression: whitespace should compare numerically equal to zero [ In reply to ]
------- You are receiving this mail because: -------
You are on the CC list for the bug.

http://bugs.exim.org/show_bug.cgi?id=749




--- Comment #3 from Phil Pennock <exim-dev@spodhuis.org> 2008-08-18 19:25:40 ---
That's what I thought, which is why I put it there.


--
Configure bugmail: http://bugs.exim.org/userprefs.cgi?tab=email

--
## List details at http://lists.exim.org/mailman/listinfo/exim-dev Exim details at http://www.exim.org/ ##
[Bug 749] Regression: whitespace should compare numerically equal to zero [ In reply to ]
------- You are receiving this mail because: -------
You are on the CC list for the bug.

http://bugs.exim.org/show_bug.cgi?id=749




--- Comment #4 from Tony Finch <dot@dotat.at> 2008-08-18 19:53:41 ---
Aargh, sorry, reading comprehension failure! I got the line numbers muddled up.


--
Configure bugmail: http://bugs.exim.org/userprefs.cgi?tab=email

--
## List details at http://lists.exim.org/mailman/listinfo/exim-dev Exim details at http://www.exim.org/ ##
[Bug 749] Regression: whitespace should compare numerically equal to zero [ In reply to ]
------- You are receiving this mail because: -------
You are on the CC list for the bug.

http://bugs.exim.org/show_bug.cgi?id=749




--- Comment #5 from Tony Finch <dot@dotat.at> 2008-08-18 19:55:39 ---
I think what I meant to ask is, does your patch make the test around line 2030
of expand.c unnecessary?


--
Configure bugmail: http://bugs.exim.org/userprefs.cgi?tab=email

--
## List details at http://lists.exim.org/mailman/listinfo/exim-dev Exim details at http://www.exim.org/ ##
[Bug 749] Regression: whitespace should compare numerically equal to zero [ In reply to ]
------- You are receiving this mail because: -------
You are on the CC list for the bug.

http://bugs.exim.org/show_bug.cgi?id=749




--- Comment #6 from Phil Pennock <exim-dev@spodhuis.org> 2008-08-18 20:51:29 ---
I haven't tested to see what expand_string() does when passed a non-NULL string
of 0 length, but I decided that having the separate diagnostic was potentially
useful when tracing data.

I believe, but haven't tested, that as long as expand_string("") returns "" or
somesuch equivalent, then the test around line 2030 is, strictly, unnecessary.

Thanks.

PS: sorry for my writing being such that comprehension is oft-times non-trivial


--
Configure bugmail: http://bugs.exim.org/userprefs.cgi?tab=email

--
## List details at http://lists.exim.org/mailman/listinfo/exim-dev Exim details at http://www.exim.org/ ##