Skip to content

Instantly share code, notes, and snippets.

@dealforest
Created June 24, 2009 17:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save dealforest/135393 to your computer and use it in GitHub Desktop.
Save dealforest/135393 to your computer and use it in GitHub Desktop.
--- 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 <sys/stropts.h>
+//# include <sys/stropts.h>
#endif
#if defined(sun) && defined(LOCKPTY) && !defined(TIOCEXCL)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment