svn commit: r250627 - projects/flex-sf/contrib/flex

Jung-uk Kim jkim at FreeBSD.org
Mon May 13 22:34:56 UTC 2013


Author: jkim
Date: Mon May 13 22:34:55 2013
New Revision: 250627
URL: http://svnweb.freebsd.org/changeset/base/250627

Log:
  Partially revert r250468 and apply a fix from NetBSD.
  
  Suggested by:	ed

Modified:
  projects/flex-sf/contrib/flex/buf.c

Modified: projects/flex-sf/contrib/flex/buf.c
==============================================================================
--- projects/flex-sf/contrib/flex/buf.c	Mon May 13 22:16:33 2013	(r250626)
+++ projects/flex-sf/contrib/flex/buf.c	Mon May 13 22:34:55 2013	(r250627)
@@ -90,7 +90,8 @@ struct Buf *buf_prints (struct Buf *buf,
  */
 struct Buf *buf_linedir (struct Buf *buf, const char* filename, int lineno)
 {
-    char *dst, *src, *t;
+    char *dst, *t;
+    const char *src;
 
     t = flex_alloc (strlen ("#line \"\"\n")          +   /* constant parts */
                     2 * strlen (filename)            +   /* filename with possibly all backslashes escaped */
@@ -98,7 +99,7 @@ struct Buf *buf_linedir (struct Buf *buf
                     1);                                  /* NUL */
     if (!t)
       flexfatal (_("Allocation of buffer for line directive failed"));
-    for (dst = t + sprintf (t, "#line %d \"", lineno), src = (char *)filename; *src; *dst++ = *src++)
+    for (dst = t + sprintf (t, "#line %d \"", lineno), src = filename; *src; *dst++ = *src++)
       if (*src == '\\')   /* escape backslashes */
         *dst++ = '\\';
     *dst++ = '"';


More information about the svn-src-projects mailing list