On Thursday 03 July 2003 14:04, Jesse Guardiani wrote:
> Sam,
>
> Take a look at the attached patches, please. 

Sorry. I forgot to attach the patches. Here they are. See attached.

-- 
Jesse Guardiani, Systems Administrator
WingNET Internet Services,
P.O. Box 2605 // Cleveland, TN 37320-2605
423-559-LINK (v)  423-559-5145 (f)
http://www.wingnet.net

Only in sqwebmail-3.5.3.20030629.mallocpatch/authlib: tags
Only in sqwebmail-3.5.3.20030629.mallocpatch/bdbobj: tags
Only in sqwebmail-3.5.3.20030629.mallocpatch/cgi: tags
Only in sqwebmail-3.5.3.20030629: config.rpath
Only in sqwebmail-3.5.3.20030629.mallocpatch/gdbmobj: tags
Only in sqwebmail-3.5.3.20030629.mallocpatch/gpglib: tags
Only in sqwebmail-3.5.3.20030629/http11: http11.h
Only in sqwebmail-3.5.3.20030629.mallocpatch/http11: tags
Only in sqwebmail-3.5.3.20030629.mallocpatch/ldapaddressbook: tags
Only in sqwebmail-3.5.3.20030629.mallocpatch/libhmac: tags
Only in sqwebmail-3.5.3.20030629.mallocpatch/liblock: tags
Only in sqwebmail-3.5.3.20030629.mallocpatch/maildir: tags
Only in sqwebmail-3.5.3.20030629.mallocpatch/makedat: tags
Only in sqwebmail-3.5.3.20030629.mallocpatch/md5: tags
Only in sqwebmail-3.5.3.20030629.mallocpatch/numlib: tags
Only in sqwebmail-3.5.3.20030629.mallocpatch/pcp/intl: tags
Only in sqwebmail-3.5.3.20030629.mallocpatch/pcp/m4: tags
Only in sqwebmail-3.5.3.20030629.mallocpatch/pcp/po: tags
Only in sqwebmail-3.5.3.20030629.mallocpatch/pcp: tags
Only in sqwebmail-3.5.3.20030629.mallocpatch/random128: tags
Only in sqwebmail-3.5.3.20030629.mallocpatch/rfc2045: tags
Only in sqwebmail-3.5.3.20030629.mallocpatch/rfc822: tags
Only in sqwebmail-3.5.3.20030629.mallocpatch/sha1: tags
Only in sqwebmail-3.5.3.20030629.mallocpatch/soxwrap: tags
Only in sqwebmail-3.5.3.20030629/sqwebmail/html: README_LANG.txt
Only in sqwebmail-3.5.3.20030629.mallocpatch/sqwebmail/html: en
Only in sqwebmail-3.5.3.20030629.mallocpatch/sqwebmail/html/en-us: tags
Only in sqwebmail-3.5.3.20030629.mallocpatch/sqwebmail/html: tags
Only in sqwebmail-3.5.3.20030629.mallocpatch/sqwebmail/images: tags
diff -u -r sqwebmail-3.5.3.20030629/sqwebmail/newmsg_create.c sqwebmail-3.5.3.20030629.mallocpatch/sqwebmail/newmsg_create.c
--- sqwebmail-3.5.3.20030629/sqwebmail/newmsg_create.c	Mon Jun  2 19:47:16 2003
+++ sqwebmail-3.5.3.20030629.mallocpatch/sqwebmail/newmsg_create.c	Thu Jul  3 13:38:09 2003
@@ -929,14 +929,13 @@
 
 	if (do_footer)
 	{
-		char	*templatedir=getenv("SQWEBMAIL_TEMPLATEDIR");
+	char	*templatedir=malloc_get_templatedir();
 	
-		if (!templatedir || !*templatedir)
-			templatedir=HTMLLIBDIR;
-
 		fp=http11_open_langfile(templatedir,
 					sqwebmail_content_language,
 					"footer");
+		free(templatedir);
+		
 		if (fp != 0)
 		{
 			while ((n=fread(buf, 1, sizeof(buf), fp)) > 0)
diff -u -r sqwebmail-3.5.3.20030629/sqwebmail/sqwebmail.c sqwebmail-3.5.3.20030629.mallocpatch/sqwebmail/sqwebmail.c
--- sqwebmail-3.5.3.20030629/sqwebmail/sqwebmail.c	Tue Jun 24 09:12:21 2003
+++ sqwebmail-3.5.3.20030629.mallocpatch/sqwebmail/sqwebmail.c	Thu Jul  3 13:55:57 2003
@@ -409,15 +409,46 @@
 	fake_exit(1);
 }
 
+
+char *malloc_get_templatedir()
+{
+char	*templatedir=getenv("SQWEBMAIL_TEMPLATEDIR");
+char	*return_ptr;
+	
+	if (!templatedir || !*templatedir)	templatedir=HTMLLIBDIR;
+
+	if (!(return_ptr=malloc(strlen(templatedir)*sizeof(char))))
+			error("Out of Memory: malloc_get_templatedir()");	
+
+	strcpy(return_ptr, templatedir);
+
+	return return_ptr;
+}
+
+
+char *malloc_get_imageurl()
+{
+char	*imageurl=getenv("SQWEBMAIL_IMAGEURL");
+char	*return_ptr;
+	
+	if (!imageurl || !*imageurl)	imageurl=IMGPATH;
+
+	if (!(return_ptr=malloc(strlen(imageurl)*sizeof(char))))
+			error("Out of Memory: malloc_get_imageurl()");
+	
+	strcpy(return_ptr, imageurl);
+	
+	return return_ptr;
+}
+
+
 FILE *open_langform(const char *lang, const char *formname,
 		    int print_header)
 {
 char	*formpath;
 FILE	*f;
-char	*templatedir=getenv("SQWEBMAIL_TEMPLATEDIR");
+char	*templatedir=malloc_get_templatedir();
 	
-	if (!templatedir || !*templatedir)	templatedir=HTMLLIBDIR;
-
 	/* templatedir/lang/formname */
 
 	if (!(formpath=malloc(strlen(templatedir)+3+
@@ -428,7 +459,10 @@
 		lang), "/"), formname);
 
 	f=fopen(formpath, "r");
+
 	free(formpath);
+	free(templatedir);
+	
 	if (f && print_header)
 		printf("Content-Language: %s\n", lang);
 	if (f)
@@ -497,6 +531,7 @@
 	}
 	else
 	{
+		char	*imageurl=malloc_get_imageurl();
 		char	*p;
 
 		MKIMG('<');
@@ -509,8 +544,11 @@
 		MKIMG('c');
 		MKIMG('=');
 		MKIMG('"');
-		for (p=IMGPATH; *p; p++)
+		for (p=imageurl; *p; p++)
 			MKIMG(*p);
+
+		free(imageurl);
+		
 		MKIMG('/');
 		while ((c=getc(f)) >= 0
 		       && c != '@' && c != ',')
@@ -1286,7 +1324,11 @@
 		}
 		else if (strcmp(kw, "SQWEBMAILCSS") == 0)
 		{
-			printf(IMGPATH "/sqwebmail.css");
+			char *imageurl=malloc_get_imageurl();
+
+			printf("%s/sqwebmail.css", imageurl);
+
+			free(imageurl);
 		}
 		else if (strcmp(kw, "timezonelist") == 0)
 		{
diff -u -r sqwebmail-3.5.3.20030629/sqwebmail/sqwebmail.h sqwebmail-3.5.3.20030629.mallocpatch/sqwebmail/sqwebmail.h
--- sqwebmail-3.5.3.20030629/sqwebmail/sqwebmail.h	Sat Mar 22 23:50:44 2003
+++ sqwebmail-3.5.3.20030629.mallocpatch/sqwebmail/sqwebmail.h	Thu Jul  3 13:36:41 2003
@@ -102,6 +102,8 @@
 extern void freeargs();
 extern void insert_include(const char *);
 extern const char *getarg(const char *);
+extern char *malloc_get_templatedir();
+extern char *malloc_get_imageurl();
 
 #define	GPGDIR "gpg"
 
Only in sqwebmail-3.5.3.20030629.mallocpatch/sqwebmail: tags
Only in sqwebmail-3.5.3.20030629: sqwebmail.spec
Only in sqwebmail-3.5.3.20030629.mallocpatch/unicode: tags
Only in sqwebmail-3.5.3.20030629.mallocpatch/userdb: tags
Only in sqwebmail-3.5.3.20030629.nomallocpatch/authlib: tags
Only in sqwebmail-3.5.3.20030629.nomallocpatch/bdbobj: tags
Only in sqwebmail-3.5.3.20030629.nomallocpatch/cgi: tags
Only in sqwebmail-3.5.3.20030629: config.rpath
Only in sqwebmail-3.5.3.20030629.nomallocpatch/gdbmobj: tags
Only in sqwebmail-3.5.3.20030629.nomallocpatch/gpglib: tags
Only in sqwebmail-3.5.3.20030629/http11: http11.h
Only in sqwebmail-3.5.3.20030629.nomallocpatch/http11: tags
Only in sqwebmail-3.5.3.20030629.nomallocpatch/ldapaddressbook: tags
Only in sqwebmail-3.5.3.20030629.nomallocpatch/libhmac: tags
Only in sqwebmail-3.5.3.20030629.nomallocpatch/liblock: tags
Only in sqwebmail-3.5.3.20030629.nomallocpatch/maildir: tags
Only in sqwebmail-3.5.3.20030629.nomallocpatch/makedat: tags
Only in sqwebmail-3.5.3.20030629.nomallocpatch/md5: tags
Only in sqwebmail-3.5.3.20030629.nomallocpatch/numlib: tags
Only in sqwebmail-3.5.3.20030629.nomallocpatch/pcp/intl: tags
Only in sqwebmail-3.5.3.20030629.nomallocpatch/pcp/m4: tags
Only in sqwebmail-3.5.3.20030629.nomallocpatch/pcp/po: tags
Only in sqwebmail-3.5.3.20030629.nomallocpatch/pcp: tags
Only in sqwebmail-3.5.3.20030629.nomallocpatch/random128: tags
Only in sqwebmail-3.5.3.20030629.nomallocpatch/rfc2045: tags
Only in sqwebmail-3.5.3.20030629.nomallocpatch/rfc822: tags
Only in sqwebmail-3.5.3.20030629.nomallocpatch/sha1: tags
Only in sqwebmail-3.5.3.20030629.nomallocpatch/soxwrap: tags
Only in sqwebmail-3.5.3.20030629/sqwebmail/html: README_LANG.txt
Only in sqwebmail-3.5.3.20030629.nomallocpatch/sqwebmail/html: en
Only in sqwebmail-3.5.3.20030629.nomallocpatch/sqwebmail/html/en-us: tags
Only in sqwebmail-3.5.3.20030629.nomallocpatch/sqwebmail/html: tags
Only in sqwebmail-3.5.3.20030629.nomallocpatch/sqwebmail/images: tags
diff -u -r sqwebmail-3.5.3.20030629/sqwebmail/newmsg_create.c sqwebmail-3.5.3.20030629.nomallocpatch/sqwebmail/newmsg_create.c
--- sqwebmail-3.5.3.20030629/sqwebmail/newmsg_create.c	Mon Jun  2 19:47:16 2003
+++ sqwebmail-3.5.3.20030629.nomallocpatch/sqwebmail/newmsg_create.c	Thu Jul  3 11:51:44 2003
@@ -929,10 +929,9 @@
 
 	if (do_footer)
 	{
-		char	*templatedir=getenv("SQWEBMAIL_TEMPLATEDIR");
+	char	templatedir[256]="";
 	
-		if (!templatedir || !*templatedir)
-			templatedir=HTMLLIBDIR;
+		get_templatedir(templatedir);
 
 		fp=http11_open_langfile(templatedir,
 					sqwebmail_content_language,
diff -u -r sqwebmail-3.5.3.20030629/sqwebmail/sqwebmail.c sqwebmail-3.5.3.20030629.nomallocpatch/sqwebmail/sqwebmail.c
--- sqwebmail-3.5.3.20030629/sqwebmail/sqwebmail.c	Tue Jun 24 09:12:21 2003
+++ sqwebmail-3.5.3.20030629.nomallocpatch/sqwebmail/sqwebmail.c	Thu Jul  3 13:18:09 2003
@@ -409,14 +409,34 @@
 	fake_exit(1);
 }
 
+void get_templatedir(char *return_templatedir)
+{
+char	*templatedir=getenv("SQWEBMAIL_TEMPLATEDIR");
+	
+	if (!templatedir || !*templatedir)	templatedir=HTMLLIBDIR;
+
+	strcpy(return_templatedir, templatedir);
+}
+
+
+void get_imageurl(char *return_imageurl)
+{
+char	*imageurl=getenv("SQWEBMAIL_IMAGEURL");
+	
+	if (!imageurl || !*imageurl)	imageurl=IMGPATH;
+
+	strcpy(return_imageurl, imageurl);
+}
+
+
 FILE *open_langform(const char *lang, const char *formname,
 		    int print_header)
 {
 char	*formpath;
 FILE	*f;
-char	*templatedir=getenv("SQWEBMAIL_TEMPLATEDIR");
+char	templatedir[256]="";
 	
-	if (!templatedir || !*templatedir)	templatedir=HTMLLIBDIR;
+	get_templatedir(templatedir);
 
 	/* templatedir/lang/formname */
 
@@ -497,8 +517,11 @@
 	}
 	else
 	{
+		char	imageurl[256]="";
 		char	*p;
 
+		get_imageurl(imageurl);
+
 		MKIMG('<');
 		MKIMG('i');
 		MKIMG('m');
@@ -509,7 +532,7 @@
 		MKIMG('c');
 		MKIMG('=');
 		MKIMG('"');
-		for (p=IMGPATH; *p; p++)
+		for (p=imageurl; *p; p++)
 			MKIMG(*p);
 		MKIMG('/');
 		while ((c=getc(f)) >= 0
@@ -1286,7 +1309,10 @@
 		}
 		else if (strcmp(kw, "SQWEBMAILCSS") == 0)
 		{
-			printf(IMGPATH "/sqwebmail.css");
+			char imageurl[256]="";
+
+			get_imageurl(imageurl);
+			printf("%s/sqwebmail.css", imageurl);
 		}
 		else if (strcmp(kw, "timezonelist") == 0)
 		{
diff -u -r sqwebmail-3.5.3.20030629/sqwebmail/sqwebmail.h sqwebmail-3.5.3.20030629.nomallocpatch/sqwebmail/sqwebmail.h
--- sqwebmail-3.5.3.20030629/sqwebmail/sqwebmail.h	Sat Mar 22 23:50:44 2003
+++ sqwebmail-3.5.3.20030629.nomallocpatch/sqwebmail/sqwebmail.h	Thu Jul  3 11:42:20 2003
@@ -102,6 +102,8 @@
 extern void freeargs();
 extern void insert_include(const char *);
 extern const char *getarg(const char *);
+extern void get_templatedir(char *);
+extern void get_imageurl(char *);
 
 #define	GPGDIR "gpg"
 
Only in sqwebmail-3.5.3.20030629.nomallocpatch/sqwebmail: tags
Only in sqwebmail-3.5.3.20030629: sqwebmail.spec
Only in sqwebmail-3.5.3.20030629.nomallocpatch/unicode: tags
Only in sqwebmail-3.5.3.20030629.nomallocpatch/userdb: tags

Reply via email to