<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
  <channel>
    <title>'hierarchical multi-cursor editor' Thread RSS Feed</title>
    <link>http://www.programmersheaven.com/</link>
    <description>Contains the latest posts from the thread 'hierarchical multi-cursor editor' posted on the 'Database &amp; SQL' forum at Programmer's Heaven.</description>
    <language>en</language>
    <copyright>Copyright 2013 Programmers Heaven</copyright>
    <pubDate>Sun, 26 May 2013 02:08:31 -0700</pubDate>
    <lastBuildDate>Sun, 26 May 2013 02:08:31 -0700</lastBuildDate>
    <generator>Argotic Syndication Framework 2007.3.0.1, http://www.codeplex.com/Argotic</generator>
    <docs>http://www.rssboard.org/rss-specification</docs>
    <ttl>360</ttl>
    <image>
      <url>http://www.programmersheaven.com/images/ph.gif</url>
      <title>Programmers Heaven</title>
      <link>http://www.programmersheaven.com/</link>
      <width>88</width>
      <height>31</height>
    </image>
    <item>
      <title>hierarchical multi-cursor editor</title>
      <link>http://www.programmersheaven.com/mb/database/312105/312105/hierarchical-multi-cursor-editor/</link>
      <description>To initiate discussion of this initial working release,&lt;br /&gt;
and seeing local discussion is kept to this forum&lt;br /&gt;
(although I think the editor may warrant its own messageboard),&lt;br /&gt;
here are some errata corresponding to this release:&lt;br /&gt;
&lt;br /&gt;
s.cc is no longer needed, it was used to track a bug when using malloc.&lt;br /&gt;
the opendir() call seems to be generating errors sometimes,&lt;br /&gt;
perhaps malloc errors but not debugged yet: this call is superfluous&lt;br /&gt;
to the design of the editor as of now and may be removed from&lt;br /&gt;
term::expand().  start the program on different machines like this:&lt;br /&gt;
route add -net 224.0.0.0 netmask 224.0.0.0 dev eth0&lt;br /&gt;
./main 1234&lt;br /&gt;
(and on other machine)&lt;br /&gt;
route add -net 224.0.0.0 netmask 224.0.0.0 dev eth0&lt;br /&gt;
./main 4321&lt;br /&gt;
(all participants currently must start with the editor&lt;br /&gt;
in the initial empty state.)&lt;br /&gt;
&lt;br /&gt;
further documentation or discussion should be forthcoming&lt;br /&gt;
with your interest.&lt;br /&gt;
&lt;br /&gt;
ciao,&lt;br /&gt;
        - D. Jeffery&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/database/312105/312105/hierarchical-multi-cursor-editor/</guid>
      <pubDate>Fri, 12 Aug 2005 21:44:50 -0700</pubDate>
      <category>Database &amp; SQL</category>
    </item>
    <item>
      <title>Re: hierarchical multi-cursor editor</title>
      <link>http://www.programmersheaven.com/mb/database/312105/428286/re-hierarchical-multi-cursor-editor/#428286</link>
      <description>Hello,&lt;br /&gt;
        If anyone was having trouble running this program just apply this&lt;br /&gt;
simple patch which uses gcc-3.3 (or try 3.4 or fix it all up); I recall&lt;br /&gt;
it was a working program when I had it.&lt;br /&gt;
&lt;br /&gt;
ciao,&lt;br /&gt;
        - M.Kyaeppd&lt;br /&gt;
&lt;br /&gt;
diff -Naur v0.10/line.cc v0.11/line.cc&lt;br /&gt;
--- v0.10/line.cc	2005-07-29 17:04:22.000000000 -0700&lt;br /&gt;
+++ v0.11/line.cc	2012-04-14 00:38:50.000000000 -0700&lt;br /&gt;
@@ -2,6 +2,7 @@&lt;br /&gt;
 #include "line.h"&lt;br /&gt;
 #include "buffer.h"&lt;br /&gt;
 #include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
+#include &amp;lt;string.h&amp;gt;			// strlen&lt;br /&gt;
 &lt;br /&gt;
 //buffer( 20 );				// segfault if you use 'size'&lt;br /&gt;
 &lt;br /&gt;
diff -Naur v0.10/main.cc v0.11/main.cc&lt;br /&gt;
--- v0.10/main.cc	2005-07-29 17:04:22.000000000 -0700&lt;br /&gt;
+++ v0.11/main.cc	2012-04-14 05:45:20.000000000 -0700&lt;br /&gt;
@@ -40,6 +40,7 @@&lt;br /&gt;
       if( FD_ISSET( fileno( stdin ), &amp;amp;inputs ) )&lt;br /&gt;
       {&lt;br /&gt;
 	 char inbuf;&lt;br /&gt;
+&lt;br /&gt;
 	 for(;;)&lt;br /&gt;
 	 {&lt;br /&gt;
 	    rc = read( fileno( stdin ), &amp;amp;inbuf, 1 );&lt;br /&gt;
@@ -181,10 +182,11 @@&lt;br /&gt;
       fcntl( fileno( stdin ), F_GETFL, 0 ) | O_ASYNC | O_NONBLOCK );&lt;br /&gt;
    fcntl( fileno( stdin ), F_SETOWN, getpid() );&lt;br /&gt;
 &lt;br /&gt;
-   init_mcast_socket();&lt;br /&gt;
+   ms = init_mcast_socket();&lt;br /&gt;
+&lt;br /&gt;
    puck.que = q = new queue( &amp;amp;puck.pad, ms, to, id );&lt;br /&gt;
 &lt;br /&gt;
-   puck.pad.clear();&lt;br /&gt;
+//   puck.pad.clear();&lt;br /&gt;
 #if 0&lt;br /&gt;
    puck.pad.debug();&lt;br /&gt;
 #endif // debug&lt;br /&gt;
diff -Naur v0.10/makefile v0.11/makefile&lt;br /&gt;
--- v0.10/makefile	2005-07-29 17:04:22.000000000 -0700&lt;br /&gt;
+++ v0.11/makefile	2012-04-14 00:45:27.000000000 -0700&lt;br /&gt;
@@ -19,7 +19,7 @@&lt;br /&gt;
 	s.cc -version -o s.s&lt;br /&gt;
 	as -V -Qy -o s.o s.s&lt;br /&gt;
 &lt;br /&gt;
-%.o: %.cc; g++ -c $&amp;lt;&lt;br /&gt;
+%.o: %.cc; g++-3.3 -c $&amp;lt;&lt;br /&gt;
 &lt;br /&gt;
 #main: main.cc kbd.cc kbd_tty.cc \&lt;br /&gt;
 #	term.cc note.cc script.cc line.cc buffer.cc&lt;br /&gt;
diff -Naur v0.10/mcast.cc v0.11/mcast.cc&lt;br /&gt;
--- v0.10/mcast.cc	2005-07-29 17:04:22.000000000 -0700&lt;br /&gt;
+++ v0.11/mcast.cc	2012-04-14 06:12:34.000000000 -0700&lt;br /&gt;
@@ -10,7 +10,7 @@&lt;br /&gt;
 #include &amp;lt;netinet/udp.h&amp;gt;		// udphdr&lt;br /&gt;
 &lt;br /&gt;
 #include &amp;lt;unistd.h&amp;gt;			// getpid&lt;br /&gt;
-#include &amp;lt;stdio.h&amp;gt;			// printf&lt;br /&gt;
+#include &amp;lt;stdio.h&amp;gt;			// printf, perror&lt;br /&gt;
 /*&lt;br /&gt;
 #include &amp;lt;net/if.h&amp;gt;&lt;br /&gt;
 #include &amp;lt;sys/ioctl.h&amp;gt;&lt;br /&gt;
@@ -23,10 +23,11 @@&lt;br /&gt;
 extern int ms; // multicast socket&lt;br /&gt;
 extern struct sockaddr_in to;&lt;br /&gt;
 extern u_int id;&lt;br /&gt;
-&lt;br /&gt;
+#define sin to&lt;br /&gt;
 int init_mcast_socket()&lt;br /&gt;
 {&lt;br /&gt;
-   struct sockaddr_in sin; // address for bind&lt;br /&gt;
+   int err = 0;&lt;br /&gt;
+   //struct sockaddr_in sin; // address for bind&lt;br /&gt;
    sin.sin_addr.s_addr = htonl( INADDR_ANY );&lt;br /&gt;
    sin.sin_port = htons( 9876 );&lt;br /&gt;
 &lt;br /&gt;
@@ -40,7 +41,9 @@&lt;br /&gt;
    int msock_reuse = 1;&lt;br /&gt;
    setsockopt( ms, SOL_SOCKET, SO_REUSEADDR, &amp;amp;msock_reuse, sizeof( int ) );&lt;br /&gt;
 &lt;br /&gt;
-   bind( ms, ( struct sockaddr* )&amp;amp;sin, sizeof( sin ) );&lt;br /&gt;
+   err = bind( ms, ( struct sockaddr* )&amp;amp;sin, sizeof( sin ) );&lt;br /&gt;
+   printf( "bind:%x:", err );&lt;br /&gt;
+   perror( "::" );&lt;br /&gt;
   &lt;br /&gt;
    u_char msock_ttl = 4;&lt;br /&gt;
    setsockopt( ms, IPPROTO_IP, IP_MULTICAST_TTL,&lt;br /&gt;
@@ -65,6 +68,8 @@&lt;br /&gt;
   &lt;br /&gt;
    if( setsockopt( ms, IPPROTO_IP, IP_ADD_MEMBERSHIP, &amp;amp;mreq, sizeof( mreq ) )&lt;br /&gt;
    &amp;lt; 0 ) printf( "failed\n" );&lt;br /&gt;
-     &lt;br /&gt;
+&lt;br /&gt;
+   fflush( stdout );&lt;br /&gt;
+&lt;br /&gt;
    return ms;&lt;br /&gt;
 }&lt;br /&gt;
diff -Naur v0.10/queue.cc v0.11/queue.cc&lt;br /&gt;
--- v0.10/queue.cc	2005-07-29 17:04:22.000000000 -0700&lt;br /&gt;
+++ v0.11/queue.cc	2012-04-14 06:08:05.000000000 -0700&lt;br /&gt;
@@ -3,6 +3,8 @@&lt;br /&gt;
 //#include &amp;lt;stdlib.h&amp;gt;			// malloc, free&lt;br /&gt;
 #include &amp;lt;stdio.h&amp;gt;			// stdin, fileno&lt;br /&gt;
 #include &amp;lt;unistd.h&amp;gt;			// read&lt;br /&gt;
+#include &amp;lt;string.h&amp;gt;			// memcpy&lt;br /&gt;
+#include &amp;lt;stdlib.h&amp;gt;			// exit&lt;br /&gt;
 &lt;br /&gt;
 char message[ 1500 ]; // dynamic allocation segfaults below&lt;br /&gt;
 &lt;br /&gt;
diff -Naur v0.10/script.cc v0.11/script.cc&lt;br /&gt;
--- v0.10/script.cc	2005-07-29 17:04:22.000000000 -0700&lt;br /&gt;
+++ v0.11/script.cc	2012-04-14 06:13:38.000000000 -0700&lt;br /&gt;
@@ -1,6 +1,7 @@&lt;br /&gt;
 //#include "null.h"&lt;br /&gt;
 #include "script.h"&lt;br /&gt;
 #include &amp;lt;stdlib.h&amp;gt; // NULL&lt;br /&gt;
+#include &amp;lt;string.h&amp;gt;			// strlen&lt;br /&gt;
 &lt;br /&gt;
 line_s::~line_s()&lt;br /&gt;
 {&lt;br /&gt;
diff -Naur v0.10/term.cc v0.11/term.cc&lt;br /&gt;
--- v0.10/term.cc	2005-07-29 17:04:22.000000000 -0700&lt;br /&gt;
+++ v0.11/term.cc	2012-04-14 00:37:12.000000000 -0700&lt;br /&gt;
@@ -1,6 +1,7 @@&lt;br /&gt;
 #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
 #include "term.h"&lt;br /&gt;
 #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
+#include &amp;lt;string.h&amp;gt;			// memcpy&lt;br /&gt;
 &lt;br /&gt;
 //#define debug_flag&lt;br /&gt;
 &lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/database/312105/428286/re-hierarchical-multi-cursor-editor/#428286</guid>
      <pubDate>Sat, 14 Apr 2012 06:28:14 -0700</pubDate>
      <category>Database &amp; SQL</category>
    </item>
    <item>
      <title>Re: hierarchical multi-cursor editor</title>
      <link>http://www.programmersheaven.com/mb/database/312105/428287/re-hierarchical-multi-cursor-editor/#428287</link>
      <description>Hello,&lt;br /&gt;
        If anyone was having trouble running this program just apply this&lt;br /&gt;
simple patch which uses gcc-3.3 (or try 3.4 or fix it all up); I recall&lt;br /&gt;
it was a working program when I had it.&lt;br /&gt;
&lt;br /&gt;
ciao,&lt;br /&gt;
        - M.Kyaeppd&lt;br /&gt;
&lt;br /&gt;
diff -Naur v0.10/line.cc v0.11/line.cc&lt;br /&gt;
--- v0.10/line.cc	2005-07-29 17:04:22.000000000 -0700&lt;br /&gt;
+++ v0.11/line.cc	2012-04-14 00:38:50.000000000 -0700&lt;br /&gt;
@@ -2,6 +2,7 @@&lt;br /&gt;
 #include "line.h"&lt;br /&gt;
 #include "buffer.h"&lt;br /&gt;
 #include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
+#include &amp;lt;string.h&amp;gt;			// strlen&lt;br /&gt;
 &lt;br /&gt;
 //buffer( 20 );				// segfault if you use 'size'&lt;br /&gt;
 &lt;br /&gt;
diff -Naur v0.10/main.cc v0.11/main.cc&lt;br /&gt;
--- v0.10/main.cc	2005-07-29 17:04:22.000000000 -0700&lt;br /&gt;
+++ v0.11/main.cc	2012-04-14 05:45:20.000000000 -0700&lt;br /&gt;
@@ -40,6 +40,7 @@&lt;br /&gt;
       if( FD_ISSET( fileno( stdin ), &amp;amp;inputs ) )&lt;br /&gt;
       {&lt;br /&gt;
 	 char inbuf;&lt;br /&gt;
+&lt;br /&gt;
 	 for(;;)&lt;br /&gt;
 	 {&lt;br /&gt;
 	    rc = read( fileno( stdin ), &amp;amp;inbuf, 1 );&lt;br /&gt;
@@ -181,10 +182,11 @@&lt;br /&gt;
       fcntl( fileno( stdin ), F_GETFL, 0 ) | O_ASYNC | O_NONBLOCK );&lt;br /&gt;
    fcntl( fileno( stdin ), F_SETOWN, getpid() );&lt;br /&gt;
 &lt;br /&gt;
-   init_mcast_socket();&lt;br /&gt;
+   ms = init_mcast_socket();&lt;br /&gt;
+&lt;br /&gt;
    puck.que = q = new queue( &amp;amp;puck.pad, ms, to, id );&lt;br /&gt;
 &lt;br /&gt;
-   puck.pad.clear();&lt;br /&gt;
+//   puck.pad.clear();&lt;br /&gt;
 #if 0&lt;br /&gt;
    puck.pad.debug();&lt;br /&gt;
 #endif // debug&lt;br /&gt;
diff -Naur v0.10/makefile v0.11/makefile&lt;br /&gt;
--- v0.10/makefile	2005-07-29 17:04:22.000000000 -0700&lt;br /&gt;
+++ v0.11/makefile	2012-04-14 00:45:27.000000000 -0700&lt;br /&gt;
@@ -19,7 +19,7 @@&lt;br /&gt;
 	s.cc -version -o s.s&lt;br /&gt;
 	as -V -Qy -o s.o s.s&lt;br /&gt;
 &lt;br /&gt;
-%.o: %.cc; g++ -c $&amp;lt;&lt;br /&gt;
+%.o: %.cc; g++-3.3 -c $&amp;lt;&lt;br /&gt;
 &lt;br /&gt;
 #main: main.cc kbd.cc kbd_tty.cc \&lt;br /&gt;
 #	term.cc note.cc script.cc line.cc buffer.cc&lt;br /&gt;
diff -Naur v0.10/mcast.cc v0.11/mcast.cc&lt;br /&gt;
--- v0.10/mcast.cc	2005-07-29 17:04:22.000000000 -0700&lt;br /&gt;
+++ v0.11/mcast.cc	2012-04-14 06:12:34.000000000 -0700&lt;br /&gt;
@@ -10,7 +10,7 @@&lt;br /&gt;
 #include &amp;lt;netinet/udp.h&amp;gt;		// udphdr&lt;br /&gt;
 &lt;br /&gt;
 #include &amp;lt;unistd.h&amp;gt;			// getpid&lt;br /&gt;
-#include &amp;lt;stdio.h&amp;gt;			// printf&lt;br /&gt;
+#include &amp;lt;stdio.h&amp;gt;			// printf, perror&lt;br /&gt;
 /*&lt;br /&gt;
 #include &amp;lt;net/if.h&amp;gt;&lt;br /&gt;
 #include &amp;lt;sys/ioctl.h&amp;gt;&lt;br /&gt;
@@ -23,10 +23,11 @@&lt;br /&gt;
 extern int ms; // multicast socket&lt;br /&gt;
 extern struct sockaddr_in to;&lt;br /&gt;
 extern u_int id;&lt;br /&gt;
-&lt;br /&gt;
+#define sin to&lt;br /&gt;
 int init_mcast_socket()&lt;br /&gt;
 {&lt;br /&gt;
-   struct sockaddr_in sin; // address for bind&lt;br /&gt;
+   int err = 0;&lt;br /&gt;
+   //struct sockaddr_in sin; // address for bind&lt;br /&gt;
    sin.sin_addr.s_addr = htonl( INADDR_ANY );&lt;br /&gt;
    sin.sin_port = htons( 9876 );&lt;br /&gt;
 &lt;br /&gt;
@@ -40,7 +41,9 @@&lt;br /&gt;
    int msock_reuse = 1;&lt;br /&gt;
    setsockopt( ms, SOL_SOCKET, SO_REUSEADDR, &amp;amp;msock_reuse, sizeof( int ) );&lt;br /&gt;
 &lt;br /&gt;
-   bind( ms, ( struct sockaddr* )&amp;amp;sin, sizeof( sin ) );&lt;br /&gt;
+   err = bind( ms, ( struct sockaddr* )&amp;amp;sin, sizeof( sin ) );&lt;br /&gt;
+   printf( "bind:%x:", err );&lt;br /&gt;
+   perror( "::" );&lt;br /&gt;
   &lt;br /&gt;
    u_char msock_ttl = 4;&lt;br /&gt;
    setsockopt( ms, IPPROTO_IP, IP_MULTICAST_TTL,&lt;br /&gt;
@@ -65,6 +68,8 @@&lt;br /&gt;
   &lt;br /&gt;
    if( setsockopt( ms, IPPROTO_IP, IP_ADD_MEMBERSHIP, &amp;amp;mreq, sizeof( mreq ) )&lt;br /&gt;
    &amp;lt; 0 ) printf( "failed\n" );&lt;br /&gt;
-     &lt;br /&gt;
+&lt;br /&gt;
+   fflush( stdout );&lt;br /&gt;
+&lt;br /&gt;
    return ms;&lt;br /&gt;
 }&lt;br /&gt;
diff -Naur v0.10/queue.cc v0.11/queue.cc&lt;br /&gt;
--- v0.10/queue.cc	2005-07-29 17:04:22.000000000 -0700&lt;br /&gt;
+++ v0.11/queue.cc	2012-04-14 06:08:05.000000000 -0700&lt;br /&gt;
@@ -3,6 +3,8 @@&lt;br /&gt;
 //#include &amp;lt;stdlib.h&amp;gt;			// malloc, free&lt;br /&gt;
 #include &amp;lt;stdio.h&amp;gt;			// stdin, fileno&lt;br /&gt;
 #include &amp;lt;unistd.h&amp;gt;			// read&lt;br /&gt;
+#include &amp;lt;string.h&amp;gt;			// memcpy&lt;br /&gt;
+#include &amp;lt;stdlib.h&amp;gt;			// exit&lt;br /&gt;
 &lt;br /&gt;
 char message[ 1500 ]; // dynamic allocation segfaults below&lt;br /&gt;
 &lt;br /&gt;
diff -Naur v0.10/script.cc v0.11/script.cc&lt;br /&gt;
--- v0.10/script.cc	2005-07-29 17:04:22.000000000 -0700&lt;br /&gt;
+++ v0.11/script.cc	2012-04-14 06:13:38.000000000 -0700&lt;br /&gt;
@@ -1,6 +1,7 @@&lt;br /&gt;
 //#include "null.h"&lt;br /&gt;
 #include "script.h"&lt;br /&gt;
 #include &amp;lt;stdlib.h&amp;gt; // NULL&lt;br /&gt;
+#include &amp;lt;string.h&amp;gt;			// strlen&lt;br /&gt;
 &lt;br /&gt;
 line_s::~line_s()&lt;br /&gt;
 {&lt;br /&gt;
diff -Naur v0.10/term.cc v0.11/term.cc&lt;br /&gt;
--- v0.10/term.cc	2005-07-29 17:04:22.000000000 -0700&lt;br /&gt;
+++ v0.11/term.cc	2012-04-14 00:37:12.000000000 -0700&lt;br /&gt;
@@ -1,6 +1,7 @@&lt;br /&gt;
 #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
 #include "term.h"&lt;br /&gt;
 #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
+#include &amp;lt;string.h&amp;gt;			// memcpy&lt;br /&gt;
 &lt;br /&gt;
 //#define debug_flag&lt;br /&gt;
 &lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/database/312105/428287/re-hierarchical-multi-cursor-editor/#428287</guid>
      <pubDate>Sat, 14 Apr 2012 06:32:37 -0700</pubDate>
      <category>Database &amp; SQL</category>
    </item>
    <item>
      <title>Re: hierarchical multi-cursor editor</title>
      <link>http://www.programmersheaven.com/mb/database/312105/428288/re-hierarchical-multi-cursor-editor/#428288</link>
      <description>Hello,&lt;br /&gt;
        If anyone was having trouble running this program just apply this&lt;br /&gt;
simple patch which uses gcc-3.3 (or 3.4 or fix it all up.)  I remember having&lt;br /&gt;
a working program when I had it before.&lt;br /&gt;
&lt;br /&gt;
cheers,&lt;br /&gt;
        - M. Kyaeppd&lt;br /&gt;
&lt;br /&gt;
diff -Naur v0.10/line.cc v0.11/line.cc&lt;br /&gt;
--- v0.10/line.cc	2005-07-29 17:04:22.000000000 -0700&lt;br /&gt;
+++ v0.11/line.cc	2012-04-14 00:38:50.000000000 -0700&lt;br /&gt;
@@ -2,6 +2,7 @@&lt;br /&gt;
 #include "line.h"&lt;br /&gt;
 #include "buffer.h"&lt;br /&gt;
 #include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
+#include &amp;lt;string.h&amp;gt;			// strlen&lt;br /&gt;
 &lt;br /&gt;
 //buffer( 20 );				// segfault if you use 'size'&lt;br /&gt;
 &lt;br /&gt;
diff -Naur v0.10/main.cc v0.11/main.cc&lt;br /&gt;
--- v0.10/main.cc	2005-07-29 17:04:22.000000000 -0700&lt;br /&gt;
+++ v0.11/main.cc	2012-04-14 05:45:20.000000000 -0700&lt;br /&gt;
@@ -40,6 +40,7 @@&lt;br /&gt;
       if( FD_ISSET( fileno( stdin ), &amp;amp;inputs ) )&lt;br /&gt;
       {&lt;br /&gt;
 	 char inbuf;&lt;br /&gt;
+&lt;br /&gt;
 	 for(;;)&lt;br /&gt;
 	 {&lt;br /&gt;
 	    rc = read( fileno( stdin ), &amp;amp;inbuf, 1 );&lt;br /&gt;
@@ -181,10 +182,11 @@&lt;br /&gt;
       fcntl( fileno( stdin ), F_GETFL, 0 ) | O_ASYNC | O_NONBLOCK );&lt;br /&gt;
    fcntl( fileno( stdin ), F_SETOWN, getpid() );&lt;br /&gt;
 &lt;br /&gt;
-   init_mcast_socket();&lt;br /&gt;
+   ms = init_mcast_socket();&lt;br /&gt;
+&lt;br /&gt;
    puck.que = q = new queue( &amp;amp;puck.pad, ms, to, id );&lt;br /&gt;
 &lt;br /&gt;
-   puck.pad.clear();&lt;br /&gt;
+//   puck.pad.clear();&lt;br /&gt;
 #if 0&lt;br /&gt;
    puck.pad.debug();&lt;br /&gt;
 #endif // debug&lt;br /&gt;
diff -Naur v0.10/makefile v0.11/makefile&lt;br /&gt;
--- v0.10/makefile	2005-07-29 17:04:22.000000000 -0700&lt;br /&gt;
+++ v0.11/makefile	2012-04-14 00:45:27.000000000 -0700&lt;br /&gt;
@@ -19,7 +19,7 @@&lt;br /&gt;
 	s.cc -version -o s.s&lt;br /&gt;
 	as -V -Qy -o s.o s.s&lt;br /&gt;
 &lt;br /&gt;
-%.o: %.cc; g++ -c $&amp;lt;&lt;br /&gt;
+%.o: %.cc; g++-3.3 -c $&amp;lt;&lt;br /&gt;
 &lt;br /&gt;
 #main: main.cc kbd.cc kbd_tty.cc \&lt;br /&gt;
 #	term.cc note.cc script.cc line.cc buffer.cc&lt;br /&gt;
diff -Naur v0.10/mcast.cc v0.11/mcast.cc&lt;br /&gt;
--- v0.10/mcast.cc	2005-07-29 17:04:22.000000000 -0700&lt;br /&gt;
+++ v0.11/mcast.cc	2012-04-14 06:12:34.000000000 -0700&lt;br /&gt;
@@ -10,7 +10,7 @@&lt;br /&gt;
 #include &amp;lt;netinet/udp.h&amp;gt;		// udphdr&lt;br /&gt;
 &lt;br /&gt;
 #include &amp;lt;unistd.h&amp;gt;			// getpid&lt;br /&gt;
-#include &amp;lt;stdio.h&amp;gt;			// printf&lt;br /&gt;
+#include &amp;lt;stdio.h&amp;gt;			// printf, perror&lt;br /&gt;
 /*&lt;br /&gt;
 #include &amp;lt;net/if.h&amp;gt;&lt;br /&gt;
 #include &amp;lt;sys/ioctl.h&amp;gt;&lt;br /&gt;
@@ -23,10 +23,11 @@&lt;br /&gt;
 extern int ms; // multicast socket&lt;br /&gt;
 extern struct sockaddr_in to;&lt;br /&gt;
 extern u_int id;&lt;br /&gt;
-&lt;br /&gt;
+#define sin to&lt;br /&gt;
 int init_mcast_socket()&lt;br /&gt;
 {&lt;br /&gt;
-   struct sockaddr_in sin; // address for bind&lt;br /&gt;
+   int err = 0;&lt;br /&gt;
+   //struct sockaddr_in sin; // address for bind&lt;br /&gt;
    sin.sin_addr.s_addr = htonl( INADDR_ANY );&lt;br /&gt;
    sin.sin_port = htons( 9876 );&lt;br /&gt;
 &lt;br /&gt;
@@ -40,7 +41,9 @@&lt;br /&gt;
    int msock_reuse = 1;&lt;br /&gt;
    setsockopt( ms, SOL_SOCKET, SO_REUSEADDR, &amp;amp;msock_reuse, sizeof( int ) );&lt;br /&gt;
 &lt;br /&gt;
-   bind( ms, ( struct sockaddr* )&amp;amp;sin, sizeof( sin ) );&lt;br /&gt;
+   err = bind( ms, ( struct sockaddr* )&amp;amp;sin, sizeof( sin ) );&lt;br /&gt;
+   printf( "bind:%x:", err );&lt;br /&gt;
+   perror( "::" );&lt;br /&gt;
   &lt;br /&gt;
    u_char msock_ttl = 4;&lt;br /&gt;
    setsockopt( ms, IPPROTO_IP, IP_MULTICAST_TTL,&lt;br /&gt;
@@ -65,6 +68,8 @@&lt;br /&gt;
   &lt;br /&gt;
    if( setsockopt( ms, IPPROTO_IP, IP_ADD_MEMBERSHIP, &amp;amp;mreq, sizeof( mreq ) )&lt;br /&gt;
    &amp;lt; 0 ) printf( "failed\n" );&lt;br /&gt;
-     &lt;br /&gt;
+&lt;br /&gt;
+   fflush( stdout );&lt;br /&gt;
+&lt;br /&gt;
    return ms;&lt;br /&gt;
 }&lt;br /&gt;
diff -Naur v0.10/queue.cc v0.11/queue.cc&lt;br /&gt;
--- v0.10/queue.cc	2005-07-29 17:04:22.000000000 -0700&lt;br /&gt;
+++ v0.11/queue.cc	2012-04-14 06:08:05.000000000 -0700&lt;br /&gt;
@@ -3,6 +3,8 @@&lt;br /&gt;
 //#include &amp;lt;stdlib.h&amp;gt;			// malloc, free&lt;br /&gt;
 #include &amp;lt;stdio.h&amp;gt;			// stdin, fileno&lt;br /&gt;
 #include &amp;lt;unistd.h&amp;gt;			// read&lt;br /&gt;
+#include &amp;lt;string.h&amp;gt;			// memcpy&lt;br /&gt;
+#include &amp;lt;stdlib.h&amp;gt;			// exit&lt;br /&gt;
 &lt;br /&gt;
 char message[ 1500 ]; // dynamic allocation segfaults below&lt;br /&gt;
 &lt;br /&gt;
diff -Naur v0.10/script.cc v0.11/script.cc&lt;br /&gt;
--- v0.10/script.cc	2005-07-29 17:04:22.000000000 -0700&lt;br /&gt;
+++ v0.11/script.cc	2012-04-14 06:13:38.000000000 -0700&lt;br /&gt;
@@ -1,6 +1,7 @@&lt;br /&gt;
 //#include "null.h"&lt;br /&gt;
 #include "script.h"&lt;br /&gt;
 #include &amp;lt;stdlib.h&amp;gt; // NULL&lt;br /&gt;
+#include &amp;lt;string.h&amp;gt;			// strlen&lt;br /&gt;
 &lt;br /&gt;
 line_s::~line_s()&lt;br /&gt;
 {&lt;br /&gt;
diff -Naur v0.10/term.cc v0.11/term.cc&lt;br /&gt;
--- v0.10/term.cc	2005-07-29 17:04:22.000000000 -0700&lt;br /&gt;
+++ v0.11/term.cc	2012-04-14 00:37:12.000000000 -0700&lt;br /&gt;
@@ -1,6 +1,7 @@&lt;br /&gt;
 #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
 #include "term.h"&lt;br /&gt;
 #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
+#include &amp;lt;string.h&amp;gt;			// memcpy&lt;br /&gt;
 &lt;br /&gt;
 //#define debug_flag&lt;br /&gt;
 &lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/database/312105/428288/re-hierarchical-multi-cursor-editor/#428288</guid>
      <pubDate>Sat, 14 Apr 2012 06:43:20 -0700</pubDate>
      <category>Database &amp; SQL</category>
    </item>
    <item>
      <title>Re: hierarchical multi-cursor editor</title>
      <link>http://www.programmersheaven.com/mb/database/312105/428374/re-hierarchical-multi-cursor-editor/#428374</link>
      <description>Hello,&lt;br /&gt;
        this is a bugfix release.  simply apply both patches in order to the program and compile with gcc 3.x.&lt;br /&gt;
&lt;br /&gt;
diff -Naur v0.11/atom.cc b/atom.cc&lt;br /&gt;
--- v0.11/atom.cc	2005-07-29 17:04:22.000000000 -0700&lt;br /&gt;
+++ b/atom.cc	2012-04-20 03:36:09.000000000 -0700&lt;br /&gt;
@@ -26,6 +26,8 @@&lt;br /&gt;
 #include &amp;lt;string.h&amp;gt; // strcat, strlen&lt;br /&gt;
 #include &amp;lt;stdio.h&amp;gt; // snprintf&lt;br /&gt;
 &lt;br /&gt;
+extern FILE* _file;&lt;br /&gt;
+&lt;br /&gt;
 char* atom::ptrtocx( atom* object )&lt;br /&gt;
 {&lt;br /&gt;
    switch( object -&amp;gt; id_mask )&lt;br /&gt;
@@ -50,13 +52,13 @@&lt;br /&gt;
 	 int size;&lt;br /&gt;
 	 if( it == 0 ) size = 1;&lt;br /&gt;
 	 else size = ( int )log10( it ) + 1;&lt;br /&gt;
-	 _name = new char[ size + 1 + strlen( pname ) ];&lt;br /&gt;
+	 _name = new char[ size + 1 + strlen( pname ) + 1 ];&lt;br /&gt;
 	 snprintf( _name, size + 1, "%d", it );&lt;br /&gt;
       }&lt;br /&gt;
       else&lt;br /&gt;
       {&lt;br /&gt;
 	 int size = strlen( object -&amp;gt; cx -&amp;gt; name );&lt;br /&gt;
-	 _name = new char[ size + 1 + strlen( pname ) ];&lt;br /&gt;
+	 _name = new char[ size + 1 + strlen( pname ) + 1 ];&lt;br /&gt;
 	 strcpy( _name, object -&amp;gt; cx -&amp;gt; name );&lt;br /&gt;
       }&lt;br /&gt;
       if( pname[ 0 ] != '\0' ) // root&lt;br /&gt;
@@ -81,6 +83,7 @@&lt;br /&gt;
       char* name,* pname;&lt;br /&gt;
       //if( object -&amp;gt; parent -&amp;gt; parent -&amp;gt; id_mask == ID_SCRIPT_DIR )&lt;br /&gt;
       pname = ptrtocx( object -&amp;gt; parent -&amp;gt; parent );&lt;br /&gt;
+      //pname = ptrtocx( object -&amp;gt; parent );&lt;br /&gt;
       int size;&lt;br /&gt;
 /*&lt;br /&gt;
       if( object -&amp;gt; cx == NULL )&lt;br /&gt;
@@ -96,14 +99,14 @@&lt;br /&gt;
 	 int size;&lt;br /&gt;
 	 if( it == 0 ) size = 1;&lt;br /&gt;
 	 else size = ( int )log10( it ) + 1;&lt;br /&gt;
-	 name = new char[ size + 1 + strlen( pname ) ];&lt;br /&gt;
+	 name = new char[ size + 1 + strlen( pname ) + 1 ];&lt;br /&gt;
 	 snprintf( name, size + 1, "%d", it );&lt;br /&gt;
       }&lt;br /&gt;
 */&lt;br /&gt;
       if( object -&amp;gt; cx == NULL )&lt;br /&gt;
       {&lt;br /&gt;
 	 int size = strlen( ( ( line* )( object -&amp;gt; parent ) ) -&amp;gt; text );&lt;br /&gt;
-	 name = new char[ size + 1 + strlen( pname ) ];&lt;br /&gt;
+	 name = new char[ size + 1 + strlen( pname ) + 1 ];&lt;br /&gt;
 	 strcpy( name, ( ( line_s* )( object -&amp;gt; parent ) ) -&amp;gt; text );&lt;br /&gt;
 	 char* _c = strchr( name, '.' );&lt;br /&gt;
 	 if( _c ) *_c = '\0';&lt;br /&gt;
@@ -111,7 +114,7 @@&lt;br /&gt;
       else&lt;br /&gt;
       {&lt;br /&gt;
 	 int size = strlen( object -&amp;gt; cx -&amp;gt; name );&lt;br /&gt;
-	 name = new char[ size + 1 + strlen( pname ) ];&lt;br /&gt;
+	 name = new char[ size + 1 + strlen( pname ) + 1 ];&lt;br /&gt;
 	 strcpy( name, object -&amp;gt; cx -&amp;gt; name );&lt;br /&gt;
       }&lt;br /&gt;
       if( pname[ 0 ] != '\0' ) // root&lt;br /&gt;
diff -Naur v0.11/context.cc b/context.cc&lt;br /&gt;
--- v0.11/context.cc	2005-07-29 17:04:22.000000000 -0700&lt;br /&gt;
+++ b/context.cc	2012-04-20 03:53:34.000000000 -0700&lt;br /&gt;
@@ -6,12 +6,63 @@&lt;br /&gt;
 {&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
-context::context( context* _up, atom* _a , char* _name )&lt;br /&gt;
+context::context( context* _up, atom* _a , char* _name ) // please new[] _name&lt;br /&gt;
 : a( _a ), name( _name ), up( _up )&lt;br /&gt;
 , first( NULL ), last( NULL ), prev( NULL ), next( NULL )&lt;br /&gt;
 {&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
+#include &amp;lt;stdlib.h&amp;gt;			// strchr&lt;br /&gt;
+#include &amp;lt;string.h&amp;gt;			// strlen, strcat, bzero, memcpy&lt;br /&gt;
+#include &amp;lt;stdio.h&amp;gt; // debug&lt;br /&gt;
+#include &amp;lt;unistd.h&amp;gt; // sync()&lt;br /&gt;
+&lt;br /&gt;
+char* context::rename( char* _name )&lt;br /&gt;
+{&lt;br /&gt;
+   char* __name = NULL;&lt;br /&gt;
+   if( name ) __name = name;&lt;br /&gt;
+   name = new char[ strlen( _name ) + 1 ];&lt;br /&gt;
+   memcpy( name, _name, strlen( _name ) + 1 );&lt;br /&gt;
+   if( __name ) delete[] __name;&lt;br /&gt;
+   return name;&lt;br /&gt;
+}&lt;br /&gt;
+&lt;br /&gt;
+char* context::path()&lt;br /&gt;
+{&lt;br /&gt;
+   char* cx = a -&amp;gt; ptrtocx( a );&lt;br /&gt;
+   char* _here = NULL;&lt;br /&gt;
+   char* _path = new char[ strlen( cx ) + 1 ];&lt;br /&gt;
+   char* _name = new char[ strlen( cx ) + 1 ];&lt;br /&gt;
+   strcpy( _name, cx );&lt;br /&gt;
+   bzero( _path, strlen( _name ) + 1 );&lt;br /&gt;
+   for(;;)&lt;br /&gt;
+   {&lt;br /&gt;
+      _here = strrchr( _name, '.' );&lt;br /&gt;
+      int bah;&lt;br /&gt;
+      if( _here == NULL )&lt;br /&gt;
+      {&lt;br /&gt;
+	 strcat( _path, _name );&lt;br /&gt;
+	 break;&lt;br /&gt;
+      }&lt;br /&gt;
+      *_here++ = '\0'; // shortening _name&lt;br /&gt;
+      bah = strlen( _here ) + 1;&lt;br /&gt;
+&lt;br /&gt;
+      char* _this = new char[ bah ]; // how to, int strchr - strchr&lt;br /&gt;
+&lt;br /&gt;
+      memcpy( _this, _here, bah );&lt;br /&gt;
+      strcat( _path, _this );&lt;br /&gt;
+      strcat( _path, "/" ); // for a total of bah added to _path&lt;br /&gt;
+&lt;br /&gt;
+      delete[] _this;&lt;br /&gt;
+   }&lt;br /&gt;
+   delete[] _name;&lt;br /&gt;
+&lt;br /&gt;
+   return _path;&lt;br /&gt;
+}&lt;br /&gt;
+      //char* _this = strchr( _here, '.' );&lt;br /&gt;
+      //if( _this != NULL )&lt;br /&gt;
+	// *_this = '\0';&lt;br /&gt;
+&lt;br /&gt;
 /*&lt;br /&gt;
 atom* context::findcx( char* );&lt;br /&gt;
 int context::possess( int );&lt;br /&gt;
diff -Naur v0.11/context.h b/context.h&lt;br /&gt;
--- v0.11/context.h	2005-07-29 17:04:22.000000000 -0700&lt;br /&gt;
+++ b/context.h	2012-04-18 09:12:44.000000000 -0700&lt;br /&gt;
@@ -14,6 +14,9 @@&lt;br /&gt;
    ~context();&lt;br /&gt;
    context( context*, atom*, char* );&lt;br /&gt;
 &lt;br /&gt;
+   char* rename( char* );&lt;br /&gt;
+   char* path();&lt;br /&gt;
+&lt;br /&gt;
 //   atom* findcx( char* );&lt;br /&gt;
 //   int possess( int );&lt;br /&gt;
 //   int colorize( int );&lt;br /&gt;
diff -Naur v0.11/main.cc b/main.cc&lt;br /&gt;
--- v0.11/main.cc	2012-04-20 03:17:29.000000000 -0700&lt;br /&gt;
+++ b/main.cc	2012-04-20 03:50:53.000000000 -0700&lt;br /&gt;
@@ -169,6 +169,8 @@&lt;br /&gt;
    signal( SIGTERM, term );&lt;br /&gt;
    signal( SIGABRT, term );&lt;br /&gt;
 &lt;br /&gt;
+   sync();&lt;br /&gt;
+&lt;br /&gt;
    if( argc &amp;lt; 2 )&lt;br /&gt;
    {&lt;br /&gt;
       printf( "usage: %s &amp;lt;id#&amp;gt;\r\n", argv[ 0 ] );&lt;br /&gt;
@@ -186,7 +188,7 @@&lt;br /&gt;
 &lt;br /&gt;
    puck.que = q = new queue( &amp;amp;puck.pad, ms, to, id );&lt;br /&gt;
 &lt;br /&gt;
-//   puck.pad.clear();&lt;br /&gt;
+   puck.pad.clear();&lt;br /&gt;
 #if 0&lt;br /&gt;
    puck.pad.debug();&lt;br /&gt;
 #endif // debug&lt;br /&gt;
diff -Naur v0.11/program.cc b/program.cc&lt;br /&gt;
--- v0.11/program.cc	2005-07-29 17:04:22.000000000 -0700&lt;br /&gt;
+++ b/program.cc	2012-04-20 02:29:48.000000000 -0700&lt;br /&gt;
@@ -67,9 +67,17 @@&lt;br /&gt;
 &lt;br /&gt;
 void term( int signal );&lt;br /&gt;
 &lt;br /&gt;
+//#include &amp;lt;stdio.h&amp;gt; // debug&lt;br /&gt;
+//#include &amp;lt;unistd.h&amp;gt; // sync()&lt;br /&gt;
+&lt;br /&gt;
 void program::mcast( void* state )&lt;br /&gt;
 {&lt;br /&gt;
 //   printf( "y" );&lt;br /&gt;
 //   fflush( stdout );&lt;br /&gt;
+//FILE* _file = fopen( "/home/mdasoh/atom.log", "a" );&lt;br /&gt;
+//fprintf( _file, ":for:\n" );&lt;br /&gt;
+//fflush( stdout );&lt;br /&gt;
+//fclose( _file );&lt;br /&gt;
+//sync();&lt;br /&gt;
   que -&amp;gt; disperse();&lt;br /&gt;
 }&lt;br /&gt;
diff -Naur v0.11/script.cc b/script.cc&lt;br /&gt;
--- v0.11/script.cc	2012-04-20 03:17:29.000000000 -0700&lt;br /&gt;
+++ b/script.cc	2012-04-20 03:43:17.000000000 -0700&lt;br /&gt;
@@ -85,15 +85,15 @@&lt;br /&gt;
 &lt;br /&gt;
 line* script::ins( line* here )&lt;br /&gt;
 {&lt;br /&gt;
-   line* brand = new line( this ),&lt;br /&gt;
+   line* brand = new line( this ), // parent&lt;br /&gt;
        * there = here -&amp;gt; next;&lt;br /&gt;
 &lt;br /&gt;
    brand -&amp;gt; last = here;&lt;br /&gt;
    brand -&amp;gt; next = there;&lt;br /&gt;
    if( there != NULL ) there -&amp;gt; last = brand;&lt;br /&gt;
    here -&amp;gt; next = brand;&lt;br /&gt;
-   //   if( bot == here )&lt;br /&gt;
-   //      bot = brand;&lt;br /&gt;
+   if( bot == here )&lt;br /&gt;
+      bot = brand;&lt;br /&gt;
 &lt;br /&gt;
    return brand;&lt;br /&gt;
 }&lt;br /&gt;
@@ -141,37 +141,32 @@&lt;br /&gt;
 }&lt;br /&gt;
 #endif&lt;br /&gt;
 &lt;br /&gt;
-FILE* _file;&lt;br /&gt;
+#include "context.h" // debug&lt;br /&gt;
 &lt;br /&gt;
 int script::load( char* path )&lt;br /&gt;
 {&lt;br /&gt;
-fprintf( _file, "2\n" );&lt;br /&gt;
-fflush( _file );&lt;br /&gt;
-&lt;br /&gt;
    close( top );&lt;br /&gt;
 &lt;br /&gt;
    bot = top = new line( this ); line* current = top;&lt;br /&gt;
 &lt;br /&gt;
-   if( 0 != chdir( path ) )&lt;br /&gt;
-fprintf( _file, "2.0\n" );&lt;br /&gt;
-fflush( _file );&lt;br /&gt;
+   if( 0 == chdir( path ) ); // solved&lt;br /&gt;
+   else if( 0 == chdir( "./" ) );&lt;br /&gt;
+   else if( 0 == chdir( "/" ) );&lt;br /&gt;
+   else&lt;br /&gt;
+{&lt;br /&gt;
+printf( "2.0.error\n" ); // reopen output&lt;br /&gt;
+fflush( stdout );&lt;br /&gt;
+}&lt;br /&gt;
 &lt;br /&gt;
    struct dirent** dir; int entries;&lt;br /&gt;
 &lt;br /&gt;
    sync();&lt;br /&gt;
 &lt;br /&gt;
-fprintf( _file, "2.1\n" );&lt;br /&gt;
-fflush( _file );&lt;br /&gt;
-&lt;br /&gt;
 //   entries = scandir( "./", &amp;amp;dir, nodots, alphasort );&lt;br /&gt;
 //   entries = scandir( "./", &amp;amp;dir, 0, alphasort );&lt;br /&gt;
    entries = scandir( "./", &amp;amp;dir, 0, 0 );&lt;br /&gt;
 &lt;br /&gt;
    if( entries == -1 )&lt;br /&gt;
-fprintf( _file, "2.2.0\n" );&lt;br /&gt;
-&lt;br /&gt;
-fprintf( _file, "2.2\n" );&lt;br /&gt;
-fflush( _file );&lt;br /&gt;
 &lt;br /&gt;
    sync();&lt;br /&gt;
 &lt;br /&gt;
@@ -192,10 +187,7 @@&lt;br /&gt;
    }&lt;br /&gt;
    else return 1;&lt;br /&gt;
 &lt;br /&gt;
-fprintf( _file, "3\n" );&lt;br /&gt;
-fflush( _file );&lt;br /&gt;
-&lt;br /&gt;
- return entries;&lt;br /&gt;
+   return entries;&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 void script::save( char* file )&lt;br /&gt;
diff -Naur v0.11/term.cc b/term.cc&lt;br /&gt;
--- v0.11/term.cc	2012-04-20 03:17:29.000000000 -0700&lt;br /&gt;
+++ b/term.cc	2012-04-20 03:47:21.000000000 -0700&lt;br /&gt;
@@ -273,8 +273,7 @@&lt;br /&gt;
       }&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
-extern FILE* _file;&lt;br /&gt;
-&lt;br /&gt;
+#include "context.h"&lt;br /&gt;
 // update each here for cursors within this context&lt;br /&gt;
 void term::expand( u_int cursor )&lt;br /&gt;
 {&lt;br /&gt;
@@ -297,34 +296,26 @@&lt;br /&gt;
       } // else&lt;br /&gt;
       if( _row == 0 ) s -&amp;gt; top = lines;&lt;br /&gt;
 &lt;br /&gt;
-// if it has a name, loop through parent contexts&lt;br /&gt;
-//      if( strlen( lines -&amp;gt; text ) == 0 )&lt;br /&gt;
+      if(0) // uncomment if you want to browse paths beginning with root&lt;br /&gt;
       {&lt;br /&gt;
 	 lines -&amp;gt; scr -&amp;gt; id_mask = ID_SCRIPT_DIR;&lt;br /&gt;
 	 atom* _a = lines -&amp;gt; parent;&lt;br /&gt;
-	 if( _a == NULL )&lt;br /&gt;
+&lt;br /&gt;
+	 char* cx = new char[ strlen( lines -&amp;gt; text ) + 1 ];&lt;br /&gt;
+	 strcpy( cx, lines -&amp;gt; text );&lt;br /&gt;
+	 if( lines -&amp;gt; parent -&amp;gt; parent )&lt;br /&gt;
 	 {&lt;br /&gt;
+	    lines -&amp;gt; scr -&amp;gt; cx = new&lt;br /&gt;
+	       context( lines -&amp;gt; parent -&amp;gt; parent -&amp;gt; cx, lines -&amp;gt; scr, cx );&lt;br /&gt;
 	 }&lt;br /&gt;
-_file = fopen( "atom.log", "a" );&lt;br /&gt;
-fprintf( _file, "1\n" );&lt;br /&gt;
-fflush( _file );&lt;br /&gt;
-	 lines -&amp;gt; scr -&amp;gt; load( "/root/hier" );&lt;br /&gt;
-fprintf( _file, "4\n" );&lt;br /&gt;
-fflush( _file );&lt;br /&gt;
-	 char* cx; // strange bug, do investigate further&lt;br /&gt;
-//	 if( lines == s -&amp;gt; top || strlen( lines -&amp;gt; last -&amp;gt; text ) != 23 )&lt;br /&gt;
-{&lt;br /&gt;
-	 cx = lines -&amp;gt; ptrtocx( lines -&amp;gt; scr );&lt;br /&gt;
-}&lt;br /&gt;
-//	 else { cx = new char[ 1 ]; cx[ 0 ] = '\0'; }&lt;br /&gt;
-	 lines -&amp;gt; clear();&lt;br /&gt;
-//	 lines -&amp;gt; ins( 0, "" );&lt;br /&gt;
-//	 cx[ 40 ] = '\0';&lt;br /&gt;
-	 lines -&amp;gt; ins( 0, cx );&lt;br /&gt;
-	 delete[] cx;&lt;br /&gt;
-fprintf( _file, "5\n" );&lt;br /&gt;
-fflush( _file );&lt;br /&gt;
-fclose( _file );&lt;br /&gt;
+	 else&lt;br /&gt;
+	 {&lt;br /&gt;
+	    lines -&amp;gt; scr -&amp;gt; cx = new&lt;br /&gt;
+	       context( NULL, lines -&amp;gt; scr, cx );&lt;br /&gt;
+	 }&lt;br /&gt;
+	 char* cx_path = lines -&amp;gt; scr -&amp;gt; cx -&amp;gt; path();&lt;br /&gt;
+	 lines -&amp;gt; scr -&amp;gt; load( cx_path );&lt;br /&gt;
+	 delete[] cx_path;&lt;br /&gt;
       }&lt;br /&gt;
    }&lt;br /&gt;
    if( _row &amp;gt; 0 )&lt;br /&gt;
@@ -360,6 +351,7 @@&lt;br /&gt;
    if( _row - _orig == note::rows ) _orig++;&lt;br /&gt;
 &lt;br /&gt;
    if( _row &amp;gt; xorig + note::rows || _row + count &amp;lt;= xorig ) return;&lt;br /&gt;
+&lt;br /&gt;
    redraw();&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
diff -Naur v0.11/thread.h b/thread.h&lt;br /&gt;
--- v0.11/thread.h	2005-07-29 17:04:22.000000000 -0700&lt;br /&gt;
+++ b/thread.h	2012-04-20 03:22:13.000000000 -0700&lt;br /&gt;
@@ -35,13 +35,13 @@&lt;br /&gt;
 //   printf( "%%" );&lt;br /&gt;
 //   fflush( stdout );&lt;br /&gt;
 &lt;br /&gt;
-   thread* top = new thread;&lt;br /&gt;
+   register thread* top = new struct thread; // malloc failure centers on this&lt;br /&gt;
 &lt;br /&gt;
 //   printf( "%%" );&lt;br /&gt;
 //   fflush( stdout );&lt;br /&gt;
 &lt;br /&gt;
    top -&amp;gt; next = next;&lt;br /&gt;
-   top -&amp;gt; addr = v; // failure centers on this&lt;br /&gt;
+   top -&amp;gt; addr = v; // with allegro, malloc failure centers on this&lt;br /&gt;
    top -&amp;gt; state = state;&lt;br /&gt;
 &lt;br /&gt;
    ( thread* )top_thread = top;&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/database/312105/428374/re-hierarchical-multi-cursor-editor/#428374</guid>
      <pubDate>Fri, 20 Apr 2012 03:05:22 -0700</pubDate>
      <category>Database &amp; SQL</category>
    </item>
  </channel>
</rss>