+ switch (*endp) {
+ case '\0': /* No unit was given so send it back as minutes */
+ case 'm':
+ result += current * 60;
+ break;
+ case 'h':
+ result += current * 3600;
+ break;
+ case 'd':
+ result += current * 86400;
+ break;
+ case 'w':
+ result += current * 604800;
+ break;
+ default:
+ return -1;
+ }
+
+ if (*endp == '\0')
+ break;
+
+ p = endp + 1;
+ }