From 61ca770a4f2c2653133d5711861f390c23863897 Mon Sep 17 00:00:00 2001 From: guy Date: Tue, 6 Jun 1995 08:50:16 +0000 Subject: [PATCH] Correzione git-svn-id: svn://10.65.10.50/trunk@1445 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- include/applicat.cpp | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/include/applicat.cpp b/include/applicat.cpp index d9e5846f1..cefc1125b 100755 --- a/include/applicat.cpp +++ b/include/applicat.cpp @@ -357,10 +357,8 @@ void TApplication::set_perms() users.put("USERNAME", utente); if (users.read() == NOERR) { - const TString80 aut(users.get("AUTSTR")); - const int max = aut.len(); - - for (int i = 1 ; i < max; i++) + const TString& aut = users.get("AUTSTR"); + for (int i = aut.len()-1; i > 0; i--) _user_aut.set(i, aut[i] == 'X'); } } @@ -369,12 +367,19 @@ void TApplication::set_perms() void TApplication::check_parameters(int & argc, char* argv[]) -{ - if (strncmp(argv[argc-1], "-u", 2) == 0 || strncmp(argv[argc-1], "/u", 2) == 0) - user() = &argv[--argc][2]; +{ + if (argc > 1) + { + const TFixed_string u(argv[argc-1]); + if (u.compare("-u", 2, TRUE) == 0 || u.compare("/u", 2, TRUE) == 0) + { + user() = u.mid(2); + argc--; + } #ifdef DBG - else user() = "PRASSI"; + else user() = "PRASSI"; #endif + } #if XVT_OS == XVT_OS_WIN const long twin_style = WSF_ICONIZABLE | WSF_SIZE | WSF_CLOSE | WSF_MAXIMIZED;