head	1.3;
access;
symbols
	old_RELEASE_5_0_0:1.2
	old_RELEASE_4_7_0:1.2
	old_RELEASE_4_6_2:1.1
	old_RELEASE_4_6_1:1.1
	old_RELEASE_4_6_0:1.1
	old_RELEASE_5_0_DP1:1.1
	old_RELEASE_4_5_0:1.1;
locks; strict;
comment	@# @;


1.3
date	2003.02.01.23.24.54;	author arved;	state dead;
branches;
next	1.2;

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.3
log
@Add tidy-devel after Repocopy from www/tidy

PR:             46620
Submitted by:   Thierry Thomas <thierry@@pompo.net>
@
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.2
log
@Avoid dumping core when $HOME is not set.

Reference:	<7mn0t271m8.wl@@black.imgsrc.co.jp>
@
text
@@


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 @@@@
@

