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
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ AC_SUBST(LT_CURRENT)
AC_SUBST(LT_REVISION)
AC_SUBST(LT_AGE)

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

# Checks for programs.

Expand Down
5 changes: 4 additions & 1 deletion src/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -904,7 +904,10 @@ Bool TY_(ParseConfigValue)( TidyDocImpl* doc, TidyOptionId optId, ctmbstr optval
TidyBuffer inbuf; /* Set up input source */
tidyBufInitWithAllocator( &inbuf, doc->allocator );
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 );

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

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

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

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 DOCTYPE_AFTER_TAGS:
case DTYPE_NOT_UPPER_CASE:
messageNode(doc, TidyWarning, rpt, fmt);
messageNode(doc, TidyWarning, rpt, "%s", fmt);
break;

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 MISSING_DOCTYPE:
case SPACE_PRECEDING_XMLDECL:
messageNode(doc, TidyWarning, node, fmt);
messageNode(doc, TidyWarning, node, "%s", fmt);
break;

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 DUPLICATE_FRAMESET:
messageNode(doc, TidyError, rpt, fmt);
messageNode(doc, TidyError, rpt, "%s", fmt);
break;

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
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@
cd tests

./testall.sh
./testxml.sh
./testaccess.sh
5 changes: 4 additions & 1 deletion tests/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# 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.