Fixed pitdate selection and query date configuration

This commit is contained in:
Deon George 2013-11-11 13:49:46 +11:00
parent 30b3eb1937
commit 16d53ae072
2 changed files with 23 additions and 5 deletions

View File

@ -34,10 +34,16 @@ dsmDate dsmStrToDate(char *s) {
if (verbose) if (verbose)
printf("dsmStrToDate: Date String: %s\n", s); printf("dsmStrToDate: Date String: %s\n", s);
/* if user key in some inputs */ /* if user key in some inputs */
if (s[0] != '\0') { if (s[0] != '\0') {
strncpy(x,s,sizeof(strchr(s,':'))); y=strchr(s,':');
if (y != NULL) {
strncpy(x,s,strlen(s)-strlen(y));
x[strlen(s)-strlen(y)] = '\0';
y = strchr(s,':')+1;
} else
x = s;
d = atol(x); d = atol(x);
date->month = d / 1000000; date->month = d / 1000000;
@ -46,8 +52,7 @@ dsmDate dsmStrToDate(char *s) {
date->day = d / 10000; date->day = d / 10000;
date->year = d % 10000; date->year = d % 10000;
if (strlen(x) != strlen(s)) { if (y != NULL) {
y = strchr(s,':')+1;
t = atol(y); t = atol(y);
date->hour = t / 10000; date->hour = t / 10000;

View File

@ -253,7 +253,20 @@ int main(int argc, char *argv[]) {
qbData.stVersion = qryBackupDataVersion; qbData.stVersion = qryBackupDataVersion;
qbData.objName = &objName; qbData.objName = &objName;
qbData.owner = ""; qbData.owner = "";
qbData.objState = (action == ACTION_DELETE) ? DSM_ACTIVE : DSM_ANY_MATCH;
switch (action) {
case ACTION_DELETE:
qbData.objState = DSM_ACTIVE;
break;
case ACTION_EXTRACT:
qbData.objState = pitdate ? DSM_ANY_MATCH : DSM_ACTIVE;
break;
case ACTION_LIST:
qbData.objState = DSM_ANY_MATCH;
break;
}
if (action == ACTION_DELETE || ! pitdate) { if (action == ACTION_DELETE || ! pitdate) {
qbData.pitDate.year = DATE_MINUS_INFINITE; qbData.pitDate.year = DATE_MINUS_INFINITE;