+2012-09-09 Paul Smith <psmith@gnu.org>
+
+ * read.c (eval): If we detect an initial UTF-8 BOM, skip it.
+ Fixes Savannah bug #36529.
+ (record_target_var): Remove unused variable "fname".
+
2012-09-09 Eli Zaretskii <eliz@gnu.org>
* read.c (unescape_char): Fix a thinko in the last change.
if (nlines < 0)
break;
- /* If this line is empty, skip it. */
line = ebuf->buffer;
+
+ /* If this is the first line, check for a UTF-8 BOM and skip it. */
+ if (ebuf->floc.lineno == 1 && line[0] == (char)0xEF
+ && line[1] == (char)0xBB && line[2] == (char)0xBF)
+ {
+ line += 3;
+ if (ISDB(DB_BASIC))
+ {
+ if (ebuf->floc.filenm)
+ printf (_("Skipping UTF-8 BOM in makefile '%s'\n"),
+ ebuf->floc.filenm);
+ else
+ printf (_("Skipping UTF-8 BOM in makefile buffer\n"));
+ }
+ }
+
+ /* If this line is empty, skip it. */
if (line[0] == '\0')
continue;
{
struct variable *v;
const char *name = filenames->name;
- const char *fname;
const char *percent;
struct pattern_var *p;
v->value = allocated_variable_expand (v->value);
else
v->value = xstrdup (v->value);
-
- fname = p->target;
}
else
{
f = f->double_colon;
initialize_file_variables (f, 1);
- fname = f->name;
current_variable_set_list = f->variables;
v = try_variable_definition (flocp, defn, origin, 1);
2012-09-09 Paul Smith <psmith@gnu.org>
+ * scripts/features/utf8: New test for UTF-8 support.
+ See Savannah bug #36529.
+
* scripts/targets/POSIX: Add tests for default macro values as
specified by IEEE Std 1003.1-2008. See Savannah bug #37069.
--- /dev/null
+# -*-perl-*-
+
+$description = "Test support for UTF-8.";
+
+$details = "";
+
+# Verify that the UTF-8 BOM is ignored.
+run_make_test("\xEF\xBB\xBFall: ; \@echo \$\@\n", '', "all");
+
+# This tells the test driver that the perl test script executed properly.
+1;