head	1.2;
access;
symbols
	RELEASE_8_3_0:1.2
	RELEASE_9_0_0:1.2
	RELEASE_7_4_0:1.2
	RELEASE_8_2_0:1.2
	RELEASE_6_EOL:1.2
	RELEASE_8_1_0:1.2
	RELEASE_7_3_0:1.2
	RELEASE_8_0_0:1.2
	RELEASE_7_2_0:1.2
	RELEASE_7_1_0:1.2
	RELEASE_6_4_0:1.2
	RELEASE_5_EOL:1.2
	RELEASE_7_0_0:1.2
	RELEASE_6_3_0:1.2
	PRE_XORG_7:1.2
	RELEASE_4_EOL:1.2
	RELEASE_6_2_0:1.2
	RELEASE_6_1_0:1.2
	RELEASE_5_5_0:1.2
	RELEASE_6_0_0:1.2
	RELEASE_5_4_0:1.2
	RELEASE_4_11_0:1.2
	RELEASE_5_3_0:1.2
	RELEASE_4_10_0:1.2
	RELEASE_5_2_1:1.2
	RELEASE_5_2_0:1.2
	RELEASE_4_9_0:1.2
	RELEASE_5_1_0:1.2
	RELEASE_4_8_0:1.2
	RELEASE_5_0_0:1.2
	RELEASE_4_7_0:1.2
	RELEASE_4_6_2:1.1
	RELEASE_4_6_1:1.1
	RELEASE_4_6_0:1.1
	RELEASE_5_0_DP1:1.1
	RELEASE_4_5_0:1.1;
locks; strict;
comment	@# @;


1.2
date	2002.08.12.02.55.03;	author kuriyama;	state Exp;
branches;
next	1.1;

1.1
date	2001.11.22.15.26.43;	author phantom;	state Exp;
branches;
next	;


desc
@@


1.2
log
@Avoid dumping core when $HOME is not set.

Reference:	<7mn0t271m8.wl@@black.imgsrc.co.jp>
@
text
@--- config.c.orig	Sat Aug  5 01:21:05 2000
+++ config.c	Mon Jul  8 23:07:17 2002
@@@@ -94,6 +94,7 @@@@
 Bool TidyMark = yes;        /* add meta element indicating tidied doc */
 Bool Emacs = no;            /* if true format error output for GNU Emacs */
 Bool LiteralAttribs = no;   /* if true attributes may use newlines */
+Bool PreserveEntities = no; /* if true don't convert entities to chars */
 
 typedef struct _lex PLex;
 
@@@@ -186,6 +187,7 @@@@
     {"doctype",         {(int *)&doctype_str},      ParseDocType},
     {"fix-backslash",   {(int *)&FixBackslash},     ParseBool},
     {"gnu-emacs",       {(int *)&Emacs},            ParseBool},
+    {"preserve-entities", {(int *)&PreserveEntities}, ParseBool},
 
   /* this must be the final entry */
     {0,          0,             0}
@@@@ -392,7 +394,8 @@@@
         home_dir = passwd->pw_dir;
     }
 
-    if (p = realloc(expanded_filename, strlen(filename)+strlen(home_dir)+1))
+    if (home_dir != NULL &&
+	(p = realloc(expanded_filename, strlen(filename)+strlen(home_dir)+1)))
     {
         strcat(strcpy(expanded_filename = p, home_dir), filename);
         return(expanded_filename);
@@@@ -423,7 +426,10 @@@@
     /* open the file and parse its contents */
 
     if ((fin = fopen(fname, "r")) == null)
-        FileError(stderr, fname);
+    {
+        if (FileExists(fname))		/* quiet file open error on */
+            FileError(stderr, fname);   /* non-existent file */
+    }
     else
     {
         config_text = null;
@@@@ -533,6 +539,12 @@@@
     {
         QuoteAmpersand = yes;
         HideEndTags = no;
+    }
+
+ /* Avoid &amp;copy; in preserve-entities case */
+    if (PreserveEntities)
+    {
+       QuoteAmpersand = no;
     }
 }
 
@


1.1
log
@Add new option '-preserve' to preserve characters entities from source file
(i.e. leave them undecoded into plain characters). This feature will be utilized
by translation teams and was successfuly tested against Russian and Japanese
Translation Projects.

Also add simple hack to not to display annoying "Can't open ~/.tidyrc" warning
message in case if ~/.tidyrc file missing.

Bump PORTREVISION.

Approved by:    Scott Kenney <saken@@hotel.rmta.org> (maintainer)
Tested by:      myself, hrs
@
text
@d1 2
a2 2
--- config.c.orig	Fri Aug  4 19:21:05 2000
+++ config.c	Mon Nov 19 14:42:14 2001
d19 11
a29 1
@@@@ -423,7 +425,10 @@@@
d41 1
a41 1
@@@@ -533,6 +538,12 @@@@
@

