Skip to content
This repository has been archived by the owner on Apr 14, 2019. It is now read-only.

Fix for mangling of non-ASCII output filenames #18

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
2 changes: 1 addition & 1 deletion configure.ac
Expand Up @@ -36,7 +36,7 @@ AC_SUBST(LT_CURRENT)
AC_SUBST(LT_REVISION) AC_SUBST(LT_REVISION)
AC_SUBST(LT_AGE) AC_SUBST(LT_AGE)


AM_INIT_AUTOMAKE(AC_PACKAGE_TARNAME, AC_PACKAGE_VERSION, AC_PACKAGE_BUGREPORT) AM_INIT_AUTOMAKE([foreign])


# Checks for programs. # Checks for programs.


Expand Down
5 changes: 4 additions & 1 deletion src/config.c
Expand Up @@ -904,7 +904,10 @@ Bool TY_(ParseConfigValue)( TidyDocImpl* doc, TidyOptionId optId, ctmbstr optval
TidyBuffer inbuf; /* Set up input source */ TidyBuffer inbuf; /* Set up input source */
tidyBufInitWithAllocator( &inbuf, doc->allocator ); tidyBufInitWithAllocator( &inbuf, doc->allocator );
tidyBufAttach( &inbuf, (byte*)optval, TY_(tmbstrlen)(optval)+1 ); tidyBufAttach( &inbuf, (byte*)optval, TY_(tmbstrlen)(optval)+1 );
doc->config.cfgIn = TY_(BufferInput)( doc, &inbuf, ASCII ); if (optId == TidyOutFile)
doc->config.cfgIn = TY_(BufferInput)( doc, &inbuf, RAW );
else
doc->config.cfgIn = TY_(BufferInput)( doc, &inbuf, ASCII );
doc->config.c = GetC( &doc->config ); doc->config.c = GetC( &doc->config );


status = option->parser( doc, option ); status = option->parser( doc, option );
Expand Down
12 changes: 6 additions & 6 deletions src/localize.c
Expand Up @@ -1351,14 +1351,14 @@ void TY_(ReportAccessWarning)( TidyDocImpl* doc, Node* node, uint code )
{ {
ctmbstr fmt = GetFormatFromCode(code); ctmbstr fmt = GetFormatFromCode(code);
doc->badAccess |= BA_WAI; doc->badAccess |= BA_WAI;
messageNode( doc, TidyAccess, node, fmt ); messageNode( doc, TidyAccess, node, "%s", fmt );
} }


void TY_(ReportAccessError)( TidyDocImpl* doc, Node* node, uint code ) void TY_(ReportAccessError)( TidyDocImpl* doc, Node* node, uint code )
{ {
ctmbstr fmt = GetFormatFromCode(code); ctmbstr fmt = GetFormatFromCode(code);
doc->badAccess |= BA_WAI; doc->badAccess |= BA_WAI;
messageNode( doc, TidyAccess, node, fmt ); messageNode( doc, TidyAccess, node, "%s", fmt );
} }


#endif /* SUPPORT_ACCESSIBILITY_CHECKS */ #endif /* SUPPORT_ACCESSIBILITY_CHECKS */
Expand All @@ -1377,7 +1377,7 @@ void TY_(ReportWarning)(TidyDocImpl* doc, Node *element, Node *node, uint code)
switch (code) switch (code)
{ {
case NESTED_QUOTATION: case NESTED_QUOTATION:
messageNode(doc, TidyWarning, rpt, fmt); messageNode(doc, TidyWarning, rpt, "%s", fmt);
break; break;


case OBSOLETE_ELEMENT: case OBSOLETE_ELEMENT:
Expand Down Expand Up @@ -1458,7 +1458,7 @@ void TY_(ReportError)(TidyDocImpl* doc, Node *element, Node *node, uint code)
case INCONSISTENT_NAMESPACE: case INCONSISTENT_NAMESPACE:
case DOCTYPE_AFTER_TAGS: case DOCTYPE_AFTER_TAGS:
case DTYPE_NOT_UPPER_CASE: case DTYPE_NOT_UPPER_CASE:
messageNode(doc, TidyWarning, rpt, fmt); messageNode(doc, TidyWarning, rpt, "%s", fmt);
break; break;


case COERCE_TO_ENDTAG: case COERCE_TO_ENDTAG:
Expand All @@ -1477,7 +1477,7 @@ void TY_(ReportError)(TidyDocImpl* doc, Node *element, Node *node, uint code)
case ENCODING_IO_CONFLICT: case ENCODING_IO_CONFLICT:
case MISSING_DOCTYPE: case MISSING_DOCTYPE:
case SPACE_PRECEDING_XMLDECL: case SPACE_PRECEDING_XMLDECL:
messageNode(doc, TidyWarning, node, fmt); messageNode(doc, TidyWarning, node, "%s", fmt);
break; break;


case TRIM_EMPTY_ELEMENT: case TRIM_EMPTY_ELEMENT:
Expand Down Expand Up @@ -1526,7 +1526,7 @@ void TY_(ReportFatal)( TidyDocImpl* doc, Node *element, Node *node, uint code)
{ {
case SUSPECTED_MISSING_QUOTE: case SUSPECTED_MISSING_QUOTE:
case DUPLICATE_FRAMESET: case DUPLICATE_FRAMESET:
messageNode(doc, TidyError, rpt, fmt); messageNode(doc, TidyError, rpt, "%s", fmt);
break; break;


case UNKNOWN_ELEMENT: case UNKNOWN_ELEMENT:
Expand Down
Empty file modified src/mappedio.c 100755 → 100644
Empty file.
Empty file modified src/mappedio.h 100755 → 100644
Empty file.
Empty file modified src/version.h 100755 → 100644
Empty file.
2 changes: 2 additions & 0 deletions test-thing.sh
Expand Up @@ -3,3 +3,5 @@
cd tests cd tests


./testall.sh ./testall.sh
./testxml.sh
./testaccess.sh
5 changes: 4 additions & 1 deletion tests/Makefile.am
@@ -1,3 +1,6 @@
# Nothing # Nothing


EXTRA_DIST = input/ output/ accessibility/ EXTRA_DIST = input output accessibility \
testcases.txt testone.sh testall.sh \
xmlcases.txt testxml.sh \
accesscases.txt testaccessone.sh testaccess.sh
Empty file modified tests/testxml.sh 100644 → 100755
Empty file.