From: Adam Dickmeiss Date: Fri, 28 Jul 1995 10:51:08 +0000 (+0000) Subject: Bug fix: account from previous session had effect when new target command X-Git-Url: http://jsfdemo.indexdata.com/cgi-bin?a=commitdiff_plain;h=e3a232b0ef0f07d6bd259bc5f031e1fa9cf1a756;p=egate.git Bug fix: account from previous session had effect when new target command was executed. --- diff --git a/kernel/kernel.h b/kernel/kernel.h index e48cbe8..f15082c 100644 --- a/kernel/kernel.h +++ b/kernel/kernel.h @@ -45,7 +45,11 @@ * Europagate, 1995 * * $Log: kernel.h,v $ - * Revision 1.19 1995/07/11 11:49:12 adam + * Revision 1.20 1995/07/28 10:51:08 adam + * Bug fix: account from previous session had effect when new target command + * was executed. + * + * Revision 1.19 1995/07/11 11:49:12 adam * LINE_MAX renamed to STR_LINE_MAX. * * Revision 1.18 1995/05/16 09:40:42 adam @@ -142,6 +146,7 @@ struct gw_kernel_info { char target[128]; char hostname[128]; char account[128]; + int account_in_session; int port; const char *lang; const char *override_portno; diff --git a/kernel/main.c b/kernel/main.c index 5c73fff..7468074 100644 --- a/kernel/main.c +++ b/kernel/main.c @@ -45,7 +45,11 @@ * Europagate, 1995 * * $Log: main.c,v $ - * Revision 1.28 1995/07/03 08:20:15 adam + * Revision 1.29 1995/07/28 10:51:08 adam + * Bug fix: account from previous session had effect when new target command + * was executed. + * + * Revision 1.28 1995/07/03 08:20:15 adam * More help information and better diagnostics. * * Revision 1.27 1995/05/19 13:25:59 adam @@ -271,6 +275,7 @@ int main (int argc, char **argv) info.override_res = NULL; *info.target = 0; *info.account = 0; + info.account_in_session = 1; info.lang = NULL; info.bibset = NULL; info.zass = NULL; @@ -613,6 +618,7 @@ void read_kernel_res (void) sizeof(info.hostname)-1); info.port = gw_res_int (info.kernel_res, "gw.portno", 210); strcpy (info.account, gw_res_get (info.kernel_res, "gw.account", "")); + info.account_in_session = 0; } /* set info.databases (all available databases for target) */ /* set info.database (first database for target) */ diff --git a/kernel/urp.c b/kernel/urp.c index c2c4010..1f1315b 100644 --- a/kernel/urp.c +++ b/kernel/urp.c @@ -45,7 +45,11 @@ * Europagate, 1995 * * $Log: urp.c,v $ - * Revision 1.45 1995/07/20 08:20:24 adam + * Revision 1.46 1995/07/28 10:51:09 adam + * Bug fix: account from previous session had effect when new target command + * was executed. + * + * Revision 1.45 1995/07/20 08:20:24 adam * Minor changes. * * Revision 1.44 1995/07/11 12:28:53 adam @@ -512,6 +516,7 @@ static int exec_account (struct ccl_token *list) } else *info.account = '\0'; + info.account_in_session = 1; return 0; } @@ -523,7 +528,10 @@ static int exec_target (struct ccl_token *list) len = list->len; memcpy (info.target, list->name, len); info.target [len] = '\0'; - + + if (!info.account_in_session) + *info.account = '\0'; + info.account_in_session = 0; read_kernel_res (); return reopen_target (); }