Author: kmachalkova Date: Fri Nov 21 18:48:37 2008 New Revision: 53533 URL: http://svn.opensuse.org/viewcvs/yast?rev=53533&view=rev Log: Use FirstChunk (splitstring), not findfirstof, as the string doesn't have to be \n-terminated (#445531) Modified: trunk/network/src/modules/DNS.ycp Modified: trunk/network/src/modules/DNS.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/network/src/modules/DNS.ycp?rev=5... ============================================================================== --- trunk/network/src/modules/DNS.ycp (original) +++ trunk/network/src/modules/DNS.ycp Fri Nov 21 18:48:37 2008 @@ -23,6 +23,7 @@ import "NetworkInterfaces"; import "Progress"; import "Service"; +import "String"; include "network/routines.ycp"; include "network/runtime.ycp"; @@ -163,7 +164,8 @@ if (SCR::Read (.target.size, "/etc/HOSTNAME") > 0) { fqhostname = (string) SCR::Read (.target.string, "/etc/HOSTNAME"); - fqhostname = substring(fqhostname, 0, findfirstof(fqhostname, "\n")); + //avoid passing nil argument when we get non-\n-terminated string (#445531) + fqhostname = String::FirstChunk( fqhostname, "\n" ); } } list<string> split = Hostname::SplitFQ (fqhostname); -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org