slang-users mailing list

[2005 Date Index] [2005 Thread Index] [Other years]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]

Re: [slang-users] slang2 pre-release snapshot 4 available


p.boekholt@xxxxxxxxx <p.boekholt@xxxxxxxxx> wrote:
>I'm running into problems with my gdbmrecent JED mode, which tries to parse
>the string "1107859249:33:1" into a timestamp and line and column numbers.
>extract_element("1107859249:33:1", 0, ':') is returning "1107859249:33:1" and
>integer("1107859249:33:1") is giving a syntax error.  The documentation says:

You found a bug that I introduced.  The patch is appended below.

>Incidentally, I can avoid this problem by using my atoi() function instead
>of integer().  I thought there would be a new atoi() or strtol()?

I will make sure that the next release has such a function.

Thanks, --John

--- slstring.c~	Mon Feb  7 00:59:23 2005
+++ slstring.c	Tue Feb  8 11:27:54 2005
@@ -215,10 +215,9 @@
 	 * this is called from create_nstring, etc...  It is unlikely that the
 	 * pointer is a slstring
 	 */
-	if (((s == bytes) 
-	     || ((ch == bytes[0])
-		 && (0 == strncmp (s, bytes, len))
-		 && (bytes [len] == 0))))
+	if (((ch == bytes[0])
+	     && (0 == strncmp (s, bytes, len))
+	     && (bytes [len] == 0)))
 	  break;
 
 	sls = sls->next;

_______________________________________________
To unsubscribe, visit http://jedsoft.org/slang/mailinglists.html


[2005 date index] [2005 thread index]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]