GPL sync + delete value implemented

svn path=/trunk/; revision=1419
This commit is contained in:
Nedko Arnaudov 2000-10-24 20:17:42 +00:00
parent 2a81cebc82
commit a248f1e7c3
29 changed files with 510 additions and 134 deletions

View file

@ -1,11 +1,23 @@
/* $Id: ShellCommandHelp.cpp,v 1.1 2000/10/04 21:04:31 ea Exp $
/* $Id: ShellCommandHelp.cpp,v 1.2 2000/10/24 20:17:41 narnaoud Exp $
*
* regexpl - Console Registry Explorer
*
* Copyright (c) 1999-2000 Nedko Arnaoudov <nedkohome@atia.com>
* Copyright (C) 2000 Nedko Arnaoudov <nedkohome@atia.com>
*
* License: GNU GPL
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
// ShellCommandHelp.cpp: implementation of the CShellCommandHelp class.
@ -48,6 +60,42 @@ int CShellCommandHelp::Execute(CConsole &rConsole, CArgumentParser& rArguments)
pCommand = m_rCommandsLinkedList.GetNextCommand(pos);
rConsole.Write(pCommand->GetHelpShortDescriptionString());
}
return 0;
}
if (_tcsicmp(pchArg,_T("GPL")) == 0)
{
HRSRC hrcGPL;
HGLOBAL hGPL;
char *pchGPL;
DWORD dwSize;
if ((hrcGPL = FindResource(NULL, _T("GPL"), _T("LICENSE")))&&
(hGPL = LoadResource(NULL,hrcGPL))&&
(pchGPL = (char *)LockResource(hGPL))&&
(dwSize = SizeofResource(NULL,hrcGPL)))
{
// save last char
char pchSaved[2];
pchSaved[0] = pchGPL[dwSize-1];
pchSaved[1] = 0;
// make null-terminated string
pchGPL[dwSize-1] = 0;
// replace all non-printable chars except CR, LF and HTAB with spaces
for (DWORD i = 0; i < dwSize ; i++)
if ((!isprint(pchGPL[i]))&&(pchGPL[i] != '\r')&&(pchGPL[i] != '\n')&&(pchGPL[i] != '\t'))
pchGPL[i] = ' ';
rConsole.Write(pchGPL);
rConsole.Write(pchSaved);
}
else
{
rConsole.Write(_T("Internal error cannot load GPL.\n"));
}
return 0;
}
while (pchArg)