while(isspace((*date_str)[0]) == FALSE) {
while(is_done == FALSE) {
parse_date(char **date_str){	gboolean converted = FALSE;	ha_time_t *new_time = NULL;	crm_malloc0(new_time, sizeof(ha_time_t));	crm_malloc0(new_time->has, sizeof(ha_has_time_t));	CRM_DEV_ASSERT(date_str != NULL);	CRM_DEV_ASSERT(strlen(*date_str) > 0);		while(isspace((*date_str)[0]) == FALSE) {		char ch = (*date_str)[0];		crm_debug_5("Switching on ch=%c (len=%d)",			    ch, (int)strlen(*date_str));				if(ch == 0) {			/* all done */			break;		} else if(ch == '/') {			/* all done - interval marker */			break;					} else if(ch == 'W') {			CRM_DEV_ASSERT(new_time->has->weeks == FALSE);			(*date_str)++;			if(parse_int(date_str, 2, 53, &new_time->weeks)){				new_time->has->weeks = TRUE;				new_time->weekyears  = new_time->years;				new_time->has->weekyears = new_time->has->years;			}			if((*date_str)[0] == '-') {				(*date_str)++;				if(parse_int(date_str, 1, 7, &new_time->weekdays)) {					new_time->has->weekdays = TRUE;				}			}						if(new_time->weekdays == 0			   || new_time->has->weekdays == FALSE) {				new_time->weekdays = 1;				new_time->has->weekdays = TRUE;			}					} else if(ch == '-') {			(*date_str)++;			if(check_for_ordinal(*date_str)) {				if(parse_int(date_str, 3, 366, &new_time->yeardays)) {					new_time->has->yeardays = TRUE;				}			}					} else if(ch == 'O') {			/* ordinal date */			(*date_str)++;			if(parse_int(date_str, 3, 366, &new_time->yeardays)){				new_time->has->yeardays = TRUE;			}		} else if(ch == 'T') {			if(new_time->has->yeardays) {				converted = convert_from_ordinal(new_time);							} else if(new_time->has->weekdays) {				converted = convert_from_weekdays(new_time);							} else {				converted = convert_from_gregorian(new_time);			}			(*date_str)++;			parse_time(date_str, new_time, TRUE);		} else if(isdigit(ch)) {			if(new_time->has->years == FALSE			   && parse_int(date_str, 4, 9999, &new_time->years)) {				new_time->has->years = TRUE;							} else if(check_for_ordinal(*date_str) && parse_int(					  date_str, 3,					  is_leap_year(new_time->years)?366:365,					  &new_time->yeardays)) {				new_time->has->yeardays = TRUE;							} else if(new_time->has->months == FALSE				  && parse_int(date_str, 2, 12, &new_time->months)) {					new_time->has->months = TRUE;							} else if(new_time->has->days == FALSE) {				if(parse_int(date_str, 2,					     days_per_month(new_time->months, new_time->years),					     &new_time->days)) {					new_time->has->days = TRUE;				}			}		} else if(isspace(ch)) {			(*date_str)++;/* 		} else if(new_time->has->months == FALSE) { *//* 			new_time->months = str_lookup(*date_str, date_month); *//* 			new_time->has->months = TRUE; */			/* 		} else if(new_time->has->days == FALSE) { *//* 			new_time->days = str_lookup(*date_str, date_day); *//* 			new_time->has->days = TRUE; */		} else {			crm_err("Unexpected characters at: %s", *date_str);			break;		}	}	if(converted) {			} else if(new_time->has->yeardays) {		convert_from_ordinal(new_time);	} else if(new_time->has->weekdays) {		convert_from_weekdays(new_time);	} else { 		convert_from_gregorian(new_time);	}	normalize_time(new_time);		log_date(LOG_DEBUG_3, "Unpacked", new_time, ha_log_date|ha_log_time);	CRM_DEV_ASSERT(is_date_sane(new_time));		return new_time;}