# HG changeset patch # User kono # Date 1220941776 -32400 # Node ID 5896e8fc8c7febbaee646529bdec4655ac21f153 # Parent 03814a8d0b2ad2b8a776757e9ba95771ca79a75c *** empty log message *** diff -r 03814a8d0b2a -r 5896e8fc8c7f src/reditor.c --- a/src/reditor.c Mon Sep 08 19:58:08 2008 +0900 +++ b/src/reditor.c Tue Sep 09 15:29:36 2008 +0900 @@ -951,13 +951,15 @@ } else if (xtra==0) { // replace case - // send saved DELETE command - assert(cursn->del_cmd!=0); - cmd = cursn->del_cmd; - rep_send_cmd(rep->smfd,cmd); - rep_free(cmd); - cursn->del_cmd = 0; + if (cursn->del_cmd!=0) { + cmd = cursn->del_cmd; + rep_send_cmd(rep->smfd,cmd); + rep_free(cmd); + cursn->del_cmd = 0; + } else { + // first insert case? + } // send saved new line as INSERT command cmd = make_cmd(REP_INSERT_CMD, cursn->sid, rep->eid, rep->seqno++, cursn->prevline, get_memline_wrp(cursn->buf, lnum)); @@ -1019,10 +1021,6 @@ session = find_session_by_id(sid); - if (textsize == 0) { - text = NULL; - } - switch (cmd) { case REP_JOIN_ACK: /* show session lineup */ @@ -1208,13 +1206,7 @@ int fd; rep_cmd *cur; { - int len = cur->len+REP_HEADER_SIZE ; - while (len>0) { - int i = writen(fd, cur->pkt, len); - if (i<0) return FALSE; - i -= len; - } - return TRUE; + return writen(fd,cur->pkt,cur->len+REP_HEADER_SIZE ); } static int @@ -1233,7 +1225,7 @@ } for (cur = cmdlist->head; cur; cur = cur->next) { - if (rep_send_cmd(fd,cur)==FALSE) { + if (writen(fd,cur->pkt,cur->len+REP_HEADER_SIZE)==FALSE) { return(FALSE); } }