Sisyphus repositório
Última atualização: 1 outubro 2023 | SRPMs: 18631 | Visitas: 37723848
en ru br
ALT Linux repositórios
S:4.4.0-alt2
5.0: 3.81-alt2
4.1: 3.81-alt2
4.0: 3.81-alt2
3.0: 3.81beta3-alt4

Group :: Desenvolvimento/Outros
RPM: make

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs e FR  Repocop 

Patch: make-3.82-cvs-24.patch
Download


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".
	* tests/scripts/features/utf8: New test for UTF-8 support.
	See Savannah bug #36529.
--- a/read.c
+++ b/read.c
@@ -619,8 +619,24 @@ eval (struct ebuffer *ebuf, int set_default)
       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;
 
@@ -1741,7 +1757,6 @@ record_target_var (struct nameseq *filenames, char *defn,
     {
       struct variable *v;
       const char *name = filenames->name;
-      const char *fname;
       const char *percent;
       struct pattern_var *p;
 
@@ -1766,8 +1781,6 @@ record_target_var (struct nameseq *filenames, char *defn,
             v->value = allocated_variable_expand (v->value);
           else
             v->value = xstrdup (v->value);
-
-          fname = p->target;
         }
       else
         {
@@ -1784,7 +1797,6 @@ record_target_var (struct nameseq *filenames, char *defn,
             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);
--- /dev/null
+++ b/tests/scripts/features/utf8
@@ -0,0 +1,11 @@
+#                                                                    -*-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;
 
projeto & código: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
mantenedor atual: Michael Shigorin
mantenedor da tradução: Fernando Martini aka fmartini © 2009