[yast-commit] r67537 - in /trunk/s390/src/modules: DASDController.ycp ZFCPController.ycp
Author: aschnell Date: Thu Feb 23 17:14:45 2012 New Revision: 67537 URL: http://svn.opensuse.org/viewcvs/yast?rev=67537&view=rev Log: - use xdigit in regexps Modified: trunk/s390/src/modules/DASDController.ycp trunk/s390/src/modules/ZFCPController.ycp Modified: trunk/s390/src/modules/DASDController.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/s390/src/modules/DASDController.ycp?rev=67537&r1=67536&r2=67537&view=diff ============================================================================== --- trunk/s390/src/modules/DASDController.ycp (original) +++ trunk/s390/src/modules/DASDController.ycp Thu Feb 23 17:14:45 2012 @@ -91,7 +91,7 @@ global boolean IsValidChannel(string channel) { - string regexp = "^([0-9a-fA-F]{1}).([0-9a-fA-F]{1}).([0-9a-fA-F]{1,4})$"; + string regexp = "^([[:xdigit:]]{1}).([[:xdigit:]]{1}).([[:xdigit:]]{4})$"; return regexpmatch(channel, regexp); } @@ -100,9 +100,7 @@ if (!IsValidChannel(channel)) return channel; - list<string> strs = splitstring(tolower(channel), "."); - strs[2] = String::PadZeros(strs[2]:"", 4); - return mergestring(strs, "."); + return tolower(channel); } Modified: trunk/s390/src/modules/ZFCPController.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/s390/src/modules/ZFCPController.ycp?rev=67537&r1=67536&r2=67537&view=diff ============================================================================== --- trunk/s390/src/modules/ZFCPController.ycp (original) +++ trunk/s390/src/modules/ZFCPController.ycp Thu Feb 23 17:14:45 2012 @@ -16,7 +16,6 @@ import "Mode"; import "Report"; import "Popup"; - import "String"; global map<integer,map<string,any> > devices = $[]; @@ -78,7 +77,7 @@ global boolean IsValidChannel(string channel) { - string regexp = "^([0-9a-fA-F]{1}).([0-9a-fA-F]{1}).([0-9a-fA-F]{1,4})$"; + string regexp = "^([[:xdigit:]]{1}).([[:xdigit:]]{1}).([[:xdigit:]]{4})$"; return regexpmatch(channel, regexp); } @@ -87,14 +86,12 @@ if (!IsValidChannel(channel)) return channel; - list<string> strs = splitstring(tolower(channel), "."); - strs[2] = String::PadZeros(strs[2]:"", 4); - return mergestring(strs, "."); + return tolower(channel); } global boolean IsValidWWPN(string wwpn) { - string regexp = "^0x([0-9a-fA-F]{1,16})$"; + string regexp = "^0x([[:xdigit:]]{1,16})$"; return regexpmatch(wwpn, regexp); } @@ -108,7 +105,7 @@ global boolean IsValidFCPLUN(string fcp_lun) { - string regexp = "^0x([0-9a-fA-F]{1,16})$"; + string regexp = "^0x([[:xdigit:]]{1,16})$"; return regexpmatch(fcp_lun, regexp); } -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
aschnell@svn2.opensuse.org