From: Mike G. v. a. <we...@ma...> - 2008-06-25 16:31:21
|
Log Message: ----------- if input to trim_spaces is empty or blank return empty string (Prevents warning messages on substitution) Tags: ---- rel-2-4-patches Modified Files: -------------- webwork2/lib/WeBWorK: Utils.pm Revision Data ------------- Index: Utils.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/Utils.pm,v retrieving revision 1.79.2.1.2.1 retrieving revision 1.79.2.1.2.2 diff -Llib/WeBWorK/Utils.pm -Llib/WeBWorK/Utils.pm -u -r1.79.2.1.2.1 -r1.79.2.1.2.2 --- lib/WeBWorK/Utils.pm +++ lib/WeBWorK/Utils.pm @@ -740,6 +740,7 @@ ## Utility function to trim whitespace off the start and end of its input sub trim_spaces { my $in = shift; + return '' unless $in; # skip blank spaces $in =~ s/^\s*(.*?)\s*$/$1/; return($in); } |