--- mark.c.orig 2009-06-25 02:03:01.000000000 +0900 +++ mark.c 2009-06-25 02:03:50.000000000 +0900 @@ -59,6 +59,8 @@ static void MarkRedisplayLine __P((int, int, int, int)); static int MarkRewrite __P((int, int, int, struct mchar *, int)); +void pbcopy(const char *strings); + extern struct layer *flayer; extern struct display *display, *displays; extern struct win *fore; @@ -484,6 +486,18 @@ /**********************************************************************/ +void pbcopy(const char *strings) +{ + FILE *pipe; + pipe = popen("/usr/bin/pbcopy", "w"); + if (pipe == NULL) { + LMsg(0, "pbcopy failed: %s", strerror(errno)); + return; + } + fprintf(pipe, "%s", strings); + pclose(pipe); +} + void MarkRoutine() @@ -1045,6 +1059,7 @@ newcopylen); else LMsg(0, "Copied %d characters into buffer", md_user->u_plop.len); + pbcopy(md_user->u_plop.buf); if (write_buffer) WriteFile(md_user, (char *)0, DUMP_EXCHANGE); in_mark = 0; --- pty.c.orig 2009-06-25 02:03:01.000000000 +0900 +++ pty.c 2009-06-25 02:03:57.000000000 +0900 @@ -40,7 +40,7 @@ /* for solaris 2.1, Unixware (SVR4.2) and possibly others */ #ifdef HAVE_STROPTS_H -# include +//# include #endif #if defined(sun) && defined(LOCKPTY) && !defined(TIOCEXCL)