[sword-svn] r3761 - in trunk: . cmake include src/mgr src/modules/common utilities

scribe at crosswire.org scribe at crosswire.org
Sat Jul 25 11:56:48 EDT 2020


Author: scribe
Date: 2020-07-25 11:56:48 -0400 (Sat, 25 Jul 2020)
New Revision: 3761

Removed:
   trunk/include/untgz.h
Modified:
   trunk/cmake/sources.cmake
   trunk/include/Makefile.am
   trunk/include/installmgr.h
   trunk/include/swversion.h
   trunk/include/zipcomprs.h
   trunk/src/mgr/installmgr.cpp
   trunk/src/mgr/swmgr.cpp
   trunk/src/modules/common/zipcomprs.cpp
   trunk/sword.kdevprj
   trunk/utilities/installmgr.cpp
Log:
Merged useful code from untgz.c into a static utility method of ZipCompress and removed untgz.h


Modified: trunk/cmake/sources.cmake
===================================================================
--- trunk/cmake/sources.cmake	2020-07-25 12:10:46 UTC (rev 3760)
+++ trunk/cmake/sources.cmake	2020-07-25 15:56:48 UTC (rev 3761)
@@ -411,7 +411,6 @@
 	include/treekeyidx.h
 	include/unicodertf.h
 	include/url.h
-	include/untgz.h
 	include/utf16utf8.h
 	include/utf8arshaping.h
 	include/utf8bidireorder.h

Modified: trunk/include/Makefile.am
===================================================================
--- trunk/include/Makefile.am	2020-07-25 12:10:46 UTC (rev 3760)
+++ trunk/include/Makefile.am	2020-07-25 15:56:48 UTC (rev 3761)
@@ -146,7 +146,6 @@
 pkginclude_HEADERS += $(swincludedir)/treekeyidx.h
 pkginclude_HEADERS += $(swincludedir)/unicodertf.h
 pkginclude_HEADERS += $(swincludedir)/url.h
-pkginclude_HEADERS += $(swincludedir)/untgz.h
 pkginclude_HEADERS += $(swincludedir)/utf16utf8.h
 pkginclude_HEADERS += $(swincludedir)/utf8arshaping.h
 pkginclude_HEADERS += $(swincludedir)/utf8bidireorder.h

Modified: trunk/include/installmgr.h
===================================================================
--- trunk/include/installmgr.h	2020-07-25 12:10:46 UTC (rev 3760)
+++ trunk/include/installmgr.h	2020-07-25 15:56:48 UTC (rev 3761)
@@ -69,7 +69,6 @@
 class SWDLLEXPORT InstallMgr {
 
 protected:
-	bool userDisclaimerConfirmed;
 	std::set<SWBuf> defaultMods;
 	char *privatePath;
 	SWBuf confPath;
@@ -94,6 +93,7 @@
 
 public:
 
+	static bool userDisclaimerConfirmed;
 	static const int MODSTAT_OLDER;
 	static const int MODSTAT_SAMEVERSION;
 	static const int MODSTAT_UPDATED;
@@ -208,7 +208,7 @@
 	 * instead of using the setter below. This is provided for clients who don't wish to inherit
 	 * InstallMgr and override method.
 	 */
-	void setUserDisclaimerConfirmed(bool val) { userDisclaimerConfirmed = val; }
+	void setUserDisclaimerConfirmed(bool val) { InstallMgr::userDisclaimerConfirmed = val; }
 
 
 	/** override this and provide an input mechanism to allow your users

Modified: trunk/include/swversion.h
===================================================================
--- trunk/include/swversion.h	2020-07-25 12:10:46 UTC (rev 3760)
+++ trunk/include/swversion.h	2020-07-25 15:56:48 UTC (rev 3761)
@@ -24,12 +24,12 @@
 #ifndef SWVERSION_H
 #define SWVERSION_H
 
-#define SWORD_VERSION_NUM 1089003749
-#define SWORD_VERSION_STR "1.8.900.3749"
+#define SWORD_VERSION_NUM 1089003760
+#define SWORD_VERSION_STR "1.8.900.3760M"
 #define SWORD_VERSION_MAJOR 1
 #define SWORD_VERSION_MINOR 8
 #define SWORD_VERSION_MICRO 900
-#define SWORD_VERSION_NANO 3749
+#define SWORD_VERSION_NANO 3760
 
 #include <defs.h>
 SWORD_NAMESPACE_START

Deleted: trunk/include/untgz.h
===================================================================
--- trunk/include/untgz.h	2020-07-25 12:10:46 UTC (rev 3760)
+++ trunk/include/untgz.h	2020-07-25 15:56:48 UTC (rev 3761)
@@ -1,10 +0,0 @@
-#ifndef UNTGZ_H
-#define UNTGZ_H
-
-#include "zlib.h"
-
-int untargz(int fd, const char *dest);
-int untar(gzFile in, const char *dest);
-
-#endif
-

Modified: trunk/include/zipcomprs.h
===================================================================
--- trunk/include/zipcomprs.h	2020-07-25 12:10:46 UTC (rev 3760)
+++ trunk/include/zipcomprs.h	2020-07-25 15:56:48 UTC (rev 3761)
@@ -30,6 +30,8 @@
 
 SWORD_NAMESPACE_START
 
+class FileDesc;
+
 class SWDLLEXPORT ZipCompress : public SWCompress {
 
 protected:
@@ -39,6 +41,8 @@
 
 	virtual void encode(void);
 	virtual void decode(void);
+
+	static char unTarGZ(FileDesc *fd, const char *destPath);
 };
 
 SWORD_NAMESPACE_END

Modified: trunk/src/mgr/installmgr.cpp
===================================================================
--- trunk/src/mgr/installmgr.cpp	2020-07-25 12:10:46 UTC (rev 3760)
+++ trunk/src/mgr/installmgr.cpp	2020-07-25 15:56:48 UTC (rev 3761)
@@ -21,17 +21,13 @@
  */
 
 #ifndef EXCLUDEZLIB
-extern "C" {
-#include <untgz.h>
-}
+#include <zipcomprs.h>
 #endif
 
 #include <installmgr.h>
 #include <filemgr.h>
 #include <utilstr.h>
 
-#include <fcntl.h>
-
 #include <swmgr.h>
 #include <swmodule.h>
 #include <swversion.h>
@@ -76,6 +72,7 @@
 const int InstallMgr::MODSTAT_NEW              = 0x008;
 const int InstallMgr::MODSTAT_CIPHERED         = 0x010;
 const int InstallMgr::MODSTAT_CIPHERKEYPRESENT = 0x020;
+bool      InstallMgr::userDisclaimerConfirmed  = false;
 
 
 // override this method and provide your own custom RemoteTransport subclass
@@ -100,9 +97,8 @@
 
 
 InstallMgr::InstallMgr(const char *privatePath, StatusReporter *sr, SWBuf u, SWBuf p) {
-	userDisclaimerConfirmed = false;
-	passive=true;
-	unverifiedPeerAllowed=true;
+	passive = true;
+	unverifiedPeerAllowed = true;
 	statusReporter = sr;
 	this->u = u;
 	this->p = p;
@@ -276,7 +272,7 @@
 			ConfigEntMap::iterator entry;
 			FileMgr::removeDir(modDir.c_str());
 			std::vector<DirEntry> dirList = FileMgr::getDirList(manager->configPath);
-			for (int i = 0; i < dirList.size(); ++i) {
+			for (unsigned int i = 0; i < dirList.size(); ++i) {
                	if (dirList[i].name.endsWith(".conf")) {
 					modFile = manager->configPath;
 					removeTrailingSlash(modFile);
@@ -401,8 +397,6 @@
 	SWBuf buffer;
 	bool aborted = false;
 	bool cipher = false;
-	DIR *dir;
-	struct dirent *ent;
 	SWBuf modFile;
 
 	SWLog::getSystemLog()->logDebug("***** InstallMgr::installModule\n");
@@ -515,7 +509,7 @@
 		if (!aborted) {
 			SWBuf confDir = sourceDir + "mods.d/";
 			std::vector<DirEntry> dirList = FileMgr::getDirList(confDir);
-               for (int i = 0; i < dirList.size() && !retVal; ++i) {
+               for (unsigned int i = 0; i < dirList.size() && !retVal; ++i) {
                	if (dirList[i].name.endsWith(".conf")) {
 					modFile = confDir;
 					modFile += dirList[i].name;
@@ -569,7 +563,7 @@
 	errorCode = remoteCopy(is, "mods.d.tar.gz", archive.c_str(), false);
 	if (!errorCode) { //sucessfully downloaded the tar,gz of module configs
 		FileDesc *fd = FileMgr::getSystemFileMgr()->open(archive.c_str(), FileMgr::RDONLY);
-		untargz(fd->getFd(), root.c_str());
+		ZipCompress::unTarGZ(fd, root.c_str());
 		FileMgr::getSystemFileMgr()->close(fd);
 	}
 	else
@@ -777,9 +771,7 @@
  */
 bool InstallMgr::isUserDisclaimerConfirmed() const {
 
-	bool confirmed = userDisclaimerConfirmed;
-	
-	if (!confirmed) {
+	if (!userDisclaimerConfirmed) {
 		std::cout << "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n";
 		std::cout << "                -=+* WARNING *+=- -=+* WARNING *+=-\n\n\n";
 		std::cout << "Although Install Manager provides a convenient way for installing\n";
@@ -800,10 +792,10 @@
 
 		char prompt[10];
 		fgets(prompt, 9, stdin);
-		confirmed = (!strcmp(prompt, "yes\n"));
+		userDisclaimerConfirmed = (!strcmp(prompt, "yes\n"));
 		std::cout << "\n";
 	}
-	return confirmed;
+	return userDisclaimerConfirmed;
 }
 
 

Modified: trunk/src/mgr/swmgr.cpp
===================================================================
--- trunk/src/mgr/swmgr.cpp	2020-07-25 12:10:46 UTC (rev 3760)
+++ trunk/src/mgr/swmgr.cpp	2020-07-25 15:56:48 UTC (rev 3761)
@@ -750,7 +750,7 @@
 	SWBuf newModFile;
 
 	std::vector<DirEntry> dirList = FileMgr::getDirList(ipath);
-	for (int i = 0; i < dirList.size(); ++i) {
+	for (unsigned int i = 0; i < dirList.size(); ++i) {
 		//check whether it ends with .conf, if it doesn't skip it!
 		if (!dirList[i].name.endsWith(".conf")) {
 			continue;
@@ -1329,7 +1329,7 @@
 	if (!basePath.endsWith("/") && !basePath.endsWith("\\")) basePath += "/";
 
 	std::vector<DirEntry> dirList = FileMgr::getDirList(dirname);
-	for (int i = 0; i < dirList.size(); ++i) {
+	for (unsigned int i = 0; i < dirList.size(); ++i) {
 		newModFile = basePath + dirList[i].name;
 
 		// mods.d

Modified: trunk/src/modules/common/zipcomprs.cpp
===================================================================
--- trunk/src/modules/common/zipcomprs.cpp	2020-07-25 12:10:46 UTC (rev 3760)
+++ trunk/src/modules/common/zipcomprs.cpp	2020-07-25 15:56:48 UTC (rev 3761)
@@ -24,10 +24,196 @@
 
 #include <stdlib.h>
 #include <string.h>
-#include <stdio.h>
+#include <filemgr.h>
+#include <swlog.h>
 #include <zipcomprs.h>
 #include <zlib.h>
+#ifndef WIN32
+#include <utime.h>
+#endif
+extern "C" {
+#include "zlib.h"
+}
 
+/* This untar code is largely lifted from zlib untgz.c
+ * written by "Pedro A. Aranda Gutirrez" <paag at tid.es>
+ * adaptation to Unix by Jean-loup Gailly <jloup at gzip.org>
+ */
+namespace {
+
+#define BLOCKSIZE 512
+#define REGTYPE	 '0'		/* regular file */
+#define AREGTYPE '\0'		/* regular file */
+#define DIRTYPE  '5'		/* directory */
+
+struct tar_header {		/* byte offset */
+  char name[100];		/*   0 */
+  char mode[8];			/* 100 */
+  char uid[8];			/* 108 */
+  char gid[8];			/* 116 */
+  char size[12];		/* 124 */
+  char mtime[12];		/* 136 */
+  char chksum[8];		/* 148 */
+  char typeflag;		/* 156 */
+  char linkname[100];		/* 157 */
+  char magic[6];		/* 257 */
+  char version[2];		/* 263 */
+  char uname[32];		/* 265 */
+  char gname[32];		/* 297 */
+  char devmajor[8];		/* 329 */
+  char devminor[8];		/* 337 */
+  char prefix[155];		/* 345 */
+				/* 500 */
+};
+
+union tar_buffer {
+  char               buffer[BLOCKSIZE];
+  struct tar_header  header;
+};
+
+int getoct(char *p,int width)
+{
+  int result = 0;
+  char c;
+  
+  while (width --)
+    {
+      c = *p++;
+      if (c == ' ')
+	continue;
+      if (c == 0)
+	break;
+      result = result * 8 + (c - '0');
+    }
+  return result;
+}
+
+int untar (gzFile in, const char *dest) {
+	union  tar_buffer buffer;
+	int    len;
+	int    err;
+	int    getheader = 1;
+	int    remaining = 0;
+	sword::FileDesc   *outfile = NULL;
+	sword::SWBuf  fname;
+	time_t tartime;
+  
+	while (1) {
+		len = gzread(in, &buffer, BLOCKSIZE);
+		if (len < 0)
+			sword::SWLog::getSystemLog()->logError(gzerror(in, &err));
+		/*
+		* Always expect complete blocks to process
+		* the tar information.
+		*/
+		if (len != BLOCKSIZE)
+			sword::SWLog::getSystemLog()->logError("gzread: incomplete block read");
+	 
+		/*
+		* If we have to get a tar header
+		*/
+		if (getheader == 1) {
+			/*
+			* if we met the end of the tar
+			* or the end-of-tar block,
+			* we are done
+			*/
+			if ((len == 0)  || (buffer.header.name[0]== 0)) break;
+
+			tartime = (time_t)getoct(buffer.header.mtime,12);
+			fname = dest;
+			if (!fname.endsWith("/") && !fname.endsWith("\\")) fname += '/';
+			fname += buffer.header.name;
+	  
+			switch (buffer.header.typeflag) {
+			case DIRTYPE: {
+				sword::SWBuf dummyFile = fname + "dummyFile";
+				sword::FileMgr::createParent(dummyFile);
+				break;
+			}
+			case REGTYPE:
+			case AREGTYPE:
+				remaining = getoct(buffer.header.size,12);
+				if (remaining) {
+					outfile = sword::FileMgr::getSystemFileMgr()->open(fname, sword::FileMgr::WRONLY);
+					if (!outfile || outfile->getFd() < 0) {
+						// try creating directory
+						if (strrchr(fname.c_str(), '/')) {
+							sword::FileMgr::createParent(fname);
+							outfile = sword::FileMgr::getSystemFileMgr()->open(fname, sword::FileMgr::CREAT|sword::FileMgr::WRONLY);
+						}
+					}
+				}
+				else {
+					if (outfile) {
+						sword::FileMgr::getSystemFileMgr()->close(outfile);
+						outfile = NULL;
+					}
+				}
+				/*
+				* could have no contents
+				*/
+				getheader = (remaining) ? 0 : 1;
+				break;
+			default:
+				break;
+			}
+		}
+		else	{
+			unsigned int bytes = (remaining > BLOCKSIZE) ? BLOCKSIZE : remaining;
+
+			if (outfile != NULL) {
+				if (outfile->write(&buffer,sizeof(char)*bytes) != bytes) {
+					sword::SWLog::getSystemLog()->logError("error writing %s skipping...", fname.c_str());
+					sword::FileMgr::getSystemFileMgr()->close(outfile);
+					sword::FileMgr::removeFile(fname);
+				}
+			}
+			remaining -= bytes;
+			if (remaining == 0) {
+				getheader = 1;
+				if (outfile != NULL) {
+
+					// All this logic is simply the set the file timestamp
+					// ugh
+					sword::FileMgr::getSystemFileMgr()->close(outfile);
+#ifdef WIN32
+					HANDLE hFile;
+					FILETIME ftm,ftLocal;
+					SYSTEMTIME st;
+					struct tm localt;
+ 
+					localt = *localtime(&tartime);
+
+					hFile = CreateFileW((const wchar_t *)utf8ToWChar(fname).getRawData(), GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL);
+		  
+					st.wYear = (WORD)localt.tm_year+1900;
+					st.wMonth = (WORD)localt.tm_mon;
+					st.wDayOfWeek = (WORD)localt.tm_wday;
+					st.wDay = (WORD)localt.tm_mday;
+					st.wHour = (WORD)localt.tm_hour;
+					st.wMinute = (WORD)localt.tm_min;
+					st.wSecond = (WORD)localt.tm_sec;
+					st.wMilliseconds = 0;
+					SystemTimeToFileTime(&st,&ftLocal);
+					LocalFileTimeToFileTime(&ftLocal,&ftm);
+					SetFileTime(hFile,&ftm,NULL,&ftm);
+					CloseHandle(hFile);
+#else
+					struct utimbuf settime;
+					settime.actime = settime.modtime = tartime;
+					utime(fname.c_str(), &settime);
+#endif
+					outfile = NULL;
+				}
+			}
+		}
+	}
+	return 0;
+}
+
+}  // end anon namespace
+
 SWORD_NAMESPACE_START
 
 /******************************************************************************
@@ -98,23 +284,20 @@
 
 	zlen = (long) (len*1.001)+15;
 	char *zbuf = new char[zlen+1];
-	if (len)
-	{
+	if (len) {
 		//printf("Doing compress\n");
-		if (compress2((Bytef*)zbuf, &zlen, (const Bytef*)buf, len, level) != Z_OK)
-		{
-			printf("ERROR in compression\n");
+		if (compress2((Bytef*)zbuf, &zlen, (const Bytef*)buf, len, level) != Z_OK) {
+			SWLog::getSystemLog()->logError("ERROR in compression");
 		}
 		else {
 			sendChars(zbuf, zlen);
 		}
 	}
-	else
-	{
-		fprintf(stderr, "ERROR: no buffer to compress\n");
+	else {
+		SWLog::getSystemLog()->logError("ERROR: no buffer to compress");
 	}
 	delete [] zbuf;
-	free (buf);
+	free(buf);
 }
 
 
@@ -170,18 +353,32 @@
 		slen = 0;
 		switch (uncompress((Bytef*)buf, &blen, (Bytef*)zbuf, zlen)){
 			case Z_OK: sendChars(buf, blen); slen = blen; break;
-			case Z_MEM_ERROR: fprintf(stderr, "ERROR: not enough memory during decompression.\n"); break;
-			case Z_BUF_ERROR: fprintf(stderr, "ERROR: not enough room in the out buffer during decompression.\n"); break;
-			case Z_DATA_ERROR: fprintf(stderr, "ERROR: corrupt data during decompression.\n"); break;
-			default: fprintf(stderr, "ERROR: an unknown error occurred during decompression.\n"); break;
+			case Z_MEM_ERROR: SWLog::getSystemLog()->logError("ERROR: not enough memory during decompression."); break;
+			case Z_BUF_ERROR: SWLog::getSystemLog()->logError("ERROR: not enough room in the out buffer during decompression."); break;
+			case Z_DATA_ERROR: SWLog::getSystemLog()->logError("ERROR: corrupt data during decompression."); break;
+			default: SWLog::getSystemLog()->logError("ERROR: an unknown error occurred during decompression."); break;
 		}
 		delete [] buf;
 	}
 	else {
-		fprintf(stderr, "ERROR: no buffer to decompress!\n");
+		SWLog::getSystemLog()->logError("ERROR: no buffer to decompress!");
 	}
 	//printf("Finished decoding\n");
 	free (zbuf);
 }
 
+
+char ZipCompress::unTarGZ(FileDesc *fd, const char *destPath) {
+	gzFile	f;
+
+	f = gzdopen(fd->getFd(), "rb");
+	if (f == NULL) {
+		SWLog::getSystemLog()->logError("Couldn't gzopen file");
+		return 1;
+	}
+
+	return untar(f, destPath);
+}
+
+
 SWORD_NAMESPACE_END

Modified: trunk/sword.kdevprj
===================================================================
--- trunk/sword.kdevprj	2020-07-25 12:10:46 UTC (rev 3760)
+++ trunk/sword.kdevprj	2020-07-25 15:56:48 UTC (rev 3761)
@@ -50,7 +50,7 @@
 type=HEADER
 
 [include/Makefile.am]
-files=include/canon.h,include/cipherfil.h,include/defs.h,include/echomod.h,include/entriesblk.h,include/femain.h,include/filemgr.h,include/gbffootnotes.h,include/gbfheadings.h,include/gbfhtml.h,include/swfilter.h,include/gbfhtmlhref.h,include/gbfmorph.h,include/gbfplain.h,include/gbfrtf.h,include/gbfstrongs.h,include/gbfthml.h,include/Greek2Greek.h,include/GreekChars.h,include/hrefcom.h,include/latin1utf16.h,include/latin1utf8.h,include/listkey.h,include/localemgr.h,include/lzsscomprs.h,include/plainfootnotes.h,include/plainhtml.h,include/rawcom.h,include/rawfiles.h,include/rawld.h,include/rawld4.h,include/rawstr.h,include/rawstr4.h,include/rawtext.h,include/rawverse.h,include/regex.h,include/roman.h,include/rtfhtml.h,include/rwphtml.h,include/rwprtf.h,include/sapphire.h,include/scsuutf8.h,include/strkey.h,include/swbasicfilter.h,include/swbyteswap.h,include/swcipher.h,include/swcom.h,include/swcomprs.h,include/swconfig.h,include/swdisp.h,include/swdisprtf.h,include/swdisprtfchap.h,include/swencodingmgr.h,include/swkey.h,include/swld.h,include/swlocale.h,include/swlog.h,include/swmacs.h,include/swmarkupmgr.h,include/swmgr.h,include/swmodule.h,include/swobject.h,include/swtext.h,include/swwinlog.h,include/tbdisp.h,include/thmlgbf.h,include/thmlhtml.h,include/thmlhtmlhref.h,include/thmlplain.h,include/thmlrtf.h,include/unicodertf.h,include/unixstr.h,include/untgz.h,include/utf16utf8.h,include/utf8cantillation.h,include/utf8greekaccents.h,include/utf8arabicpoints.h,include/utf8hebrewpoints.h,include/utf8html.h,include/utf8latin1.h,include/utf8transliterator.h,include/utf8utf16.h,include/utilconf.h,include/utilfuns.h,include/utilstr.h,include/versekey.h,include/zcom.h,include/zconf.h,include/zipcomprs.h,include/zlib.h,include/ztext.h,include/zverse.h,include/thmlfootnotes.h,include/thmlheadings.h,include/thmllemma.h,include/thmlmorph.h,include/thmlscripref.h,include/thmlstrongs.h,include/utf8cnormalizer.h,include/utf8arshaping.h,include/utf8bidireorder.h,include/utf8nfc.h,include/utf8nfkd.h,include/encfiltmgr.h,include/swversion.h,include/swfiltermgr.h,include/markupfiltmgr.h,include/rawgenbook.h,include/swgenbook.h,include/treekey.h,include/thmlvariants.h,include/treekeyidx.h,include/zld.h,include/zstr.h,include/swinputmeth.h,include/nullim.h,include/hebrewmcim.h,include/flatapi.h,include/cdsourcemgr.h,include/ftpparse.h,include/gbfosis.h,include/gbfredletterwords.h,include/greeklexattribs.h,include/installmgr.h,include/osismorph.h,include/osisstrongs.h,include/remotesourcemgr.h,include/multimapwdef.h,include/swcacher.h,include/swinstallmgr.h,include/swremotemgr.h,include/swsourcemgr.h,include/sysdata.h,include/thmlosis.h,include/swbuf.h,include/osisplain.h,include/osisrtf.h
+files=include/canon.h,include/cipherfil.h,include/defs.h,include/echomod.h,include/entriesblk.h,include/femain.h,include/filemgr.h,include/gbffootnotes.h,include/gbfheadings.h,include/gbfhtml.h,include/swfilter.h,include/gbfhtmlhref.h,include/gbfmorph.h,include/gbfplain.h,include/gbfrtf.h,include/gbfstrongs.h,include/gbfthml.h,include/Greek2Greek.h,include/GreekChars.h,include/hrefcom.h,include/latin1utf16.h,include/latin1utf8.h,include/listkey.h,include/localemgr.h,include/lzsscomprs.h,include/plainfootnotes.h,include/plainhtml.h,include/rawcom.h,include/rawfiles.h,include/rawld.h,include/rawld4.h,include/rawstr.h,include/rawstr4.h,include/rawtext.h,include/rawverse.h,include/regex.h,include/roman.h,include/rtfhtml.h,include/rwphtml.h,include/rwprtf.h,include/sapphire.h,include/scsuutf8.h,include/strkey.h,include/swbasicfilter.h,include/swbyteswap.h,include/swcipher.h,include/swcom.h,include/swcomprs.h,include/swconfig.h,include/swdisp.h,include/swdisprtf.h,include/swdisprtfchap.h,include/swencodingmgr.h,include/swkey.h,include/swld.h,include/swlocale.h,include/swlog.h,include/swmacs.h,include/swmarkupmgr.h,include/swmgr.h,include/swmodule.h,include/swobject.h,include/swtext.h,include/swwinlog.h,include/tbdisp.h,include/thmlgbf.h,include/thmlhtml.h,include/thmlhtmlhref.h,include/thmlplain.h,include/thmlrtf.h,include/unicodertf.h,include/unixstr.h,include/utf16utf8.h,include/utf8cantillation.h,include/utf8greekaccents.h,include/utf8arabicpoints.h,include/utf8hebrewpoints.h,include/utf8html.h,include/utf8latin1.h,include/utf8transliterator.h,include/utf8utf16.h,include/utilconf.h,include/utilfuns.h,include/utilstr.h,include/versekey.h,include/zcom.h,include/zconf.h,include/zipcomprs.h,include/zlib.h,include/ztext.h,include/zverse.h,include/thmlfootnotes.h,include/thmlheadings.h,include/thmllemma.h,include/thmlmorph.h,include/thmlscripref.h,include/thmlstrongs.h,include/utf8cnormalizer.h,include/utf8arshaping.h,include/utf8bidireorder.h,include/utf8nfc.h,include/utf8nfkd.h,include/encfiltmgr.h,include/swversion.h,include/swfiltermgr.h,include/markupfiltmgr.h,include/rawgenbook.h,include/swgenbook.h,include/treekey.h,include/thmlvariants.h,include/treekeyidx.h,include/zld.h,include/zstr.h,include/swinputmeth.h,include/nullim.h,include/hebrewmcim.h,include/flatapi.h,include/cdsourcemgr.h,include/ftpparse.h,include/gbfosis.h,include/gbfredletterwords.h,include/greeklexattribs.h,include/installmgr.h,include/osismorph.h,include/osisstrongs.h,include/remotesourcemgr.h,include/multimapwdef.h,include/swcacher.h,include/swinstallmgr.h,include/swremotemgr.h,include/swsourcemgr.h,include/sysdata.h,include/thmlosis.h,include/swbuf.h,include/osisplain.h,include/osisrtf.h
 sub_dirs=
 type=normal
 
@@ -702,12 +702,6 @@
 install_location=
 type=HEADER
 
-[include/untgz.h]
-dist=true
-install=false
-install_location=
-type=HEADER
-
 [include/utf16utf8.h]
 dist=true
 install=false

Modified: trunk/utilities/installmgr.cpp
===================================================================
--- trunk/utilities/installmgr.cpp	2020-07-25 12:10:46 UTC (rev 3760)
+++ trunk/utilities/installmgr.cpp	2020-07-25 15:56:48 UTC (rev 3761)
@@ -77,9 +77,7 @@
 		// convenience as an example.
 		// you can copy and adjust for your frontend
 
-		bool confirmed = userDisclaimerConfirmed;
-	
-		if (!confirmed) {
+		if (!userDisclaimerConfirmed) {
 			std::cout << "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n";
 			std::cout << "                -=+* WARNING *+=- -=+* WARNING *+=-\n\n\n";
 			std::cout << "Although Install Manager provides a convenient way for installing\n";
@@ -100,10 +98,10 @@
 
 			char prompt[10];
 			fgets(prompt, 9, stdin);
-			confirmed = (!strcmp(prompt, "yes\n"));
+			userDisclaimerConfirmed = (!strcmp(prompt, "yes\n"));
 			std::cout << "\n";
 		}
-		return confirmed;
+		return userDisclaimerConfirmed;
 	}
 
 };



More information about the sword-cvs mailing list