commit b50e82ebf23c14b6d20ebb17069a472496d9a10e
Author: Michael Buch <[email protected]>
Date:   Sat Feb 2 15:10:14 2019 +0000

    fix broken git refs in open_copied_url patch

diff --git a/st.suckless.org/patches/open_copied_url/index.md 
b/st.suckless.org/patches/open_copied_url/index.md
index 258b0bd9..2447ed66 100644
--- a/st.suckless.org/patches/open_copied_url/index.md
+++ b/st.suckless.org/patches/open_copied_url/index.md
@@ -23,8 +23,8 @@ to open the contents of the clipboard in the default browser.
 
 Download
 --------
-* 
[st-openclipboard-20180525-2c2500c.diff](st-openclipboard-20180525-2c2500c.diff)
-* 
[st-openclipboard-20190105-153c5c7.diff](st-openclipboard-20190105-153c5c7.diff)
+* [st-openclipboard-20190202-0.8.1.diff](st-openclipboard-20190202-0.8.1.diff)
+* 
[st-openclipboard-20190202-3be4cf1.diff](st-openclipboard-20190202-3be4cf1.diff)
 
 Authors
 -------
diff --git 
a/st.suckless.org/patches/open_copied_url/st-openclipboard-20190105-153c5c7.diff
 
b/st.suckless.org/patches/open_copied_url/st-openclipboard-20190105-153c5c7.diff
deleted file mode 100644
index e5fbaade..00000000
--- 
a/st.suckless.org/patches/open_copied_url/st-openclipboard-20190105-153c5c7.diff
+++ /dev/null
@@ -1,71 +0,0 @@
-From 153c5c7667faa273af681efc9a7012b0c09d0e04 Mon Sep 17 00:00:00 2001
-From: Sai Praneeth Reddy <[email protected]>
-Date: Sat, 5 Jan 2019 18:01:04 +0530
-Subject: [PATCH] Update base patch
-
-to open the external program independently. Otherwise, the terminal
-is rendered unusable until the external program is closed.
----
- config.def.h |  1 +
- st.h         |  1 +
- x.c          | 23 +++++++++++++++++++++++
- 3 files changed, 25 insertions(+)
-
-diff --git a/config.def.h b/config.def.h
-index 823e79f..fcd0101 100644
---- a/config.def.h
-+++ b/config.def.h
-@@ -177,6 +177,7 @@ static Shortcut shortcuts[] = {
-       { TERMMOD,              XK_V,           clippaste,      {.i =  0} },
-       { TERMMOD,              XK_Y,           selpaste,       {.i =  0} },
-       { TERMMOD,              XK_Num_Lock,    numlock,        {.i =  0} },
-+      { MODKEY,               XK_o,           opencopied,     {.v = 
"xdg-open"} },
- };
- 
- /*
-diff --git a/st.h b/st.h
-index 38c61c4..a0d7a83 100644
---- a/st.h
-+++ b/st.h
-@@ -80,6 +80,7 @@ void die(const char *, ...);
- void redraw(void);
- void draw(void);
- 
-+void opencopied(const Arg *);
- void printscreen(const Arg *);
- void printsel(const Arg *);
- void sendbreak(const Arg *);
-diff --git a/x.c b/x.c
-index 0422421..6a5ef48 100644
---- a/x.c
-+++ b/x.c
-@@ -1953,3 +1953,26 @@ run:
- 
-       return 0;
- }
-+
-+void
-+opencopied(const Arg *arg)
-+{
-+      const size_t max_cmd = 2048;
-+      const char *clip = xsel.clipboard;
-+      if(!clip) {
-+              fprintf(stderr, "Warning: nothing copied to clipboard
");
-+              return;
-+      }
-+
-+      /* account for space/quote (3) and -+   char cmd[max_cmd + strlen(clip) 
+ 4];
-+      strncpy(cmd, (char *)arg->v, max_cmd);
-+      cmd[max_cmd] = '-+
-+      strcat(cmd, " \"");
-+      strcat(cmd, clip);
-+      strcat(cmd, "\"");
-+      strcat(cmd, " &");
-+
-+      system(cmd);
-+}
--- 
-2.20.1
-
diff --git 
a/st.suckless.org/patches/open_copied_url/st-openclipboard-20180525-2c2500c.diff
 b/st.suckless.org/patches/open_copied_url/st-openclipboard-20190202-0.8.1.diff
similarity index 62%
rename from 
st.suckless.org/patches/open_copied_url/st-openclipboard-20180525-2c2500c.diff
rename to 
st.suckless.org/patches/open_copied_url/st-openclipboard-20190202-0.8.1.diff
index 88aea1e4..bdea09a0 100644
--- 
a/st.suckless.org/patches/open_copied_url/st-openclipboard-20180525-2c2500c.diff
+++ 
b/st.suckless.org/patches/open_copied_url/st-openclipboard-20190202-0.8.1.diff
@@ -1,18 +1,13 @@
-From 2c2500c057433148c49465b9d009193ffcef6432 Mon Sep 17 00:00:00 2001
+From b57f6899b277265f19b6ec94d8c476991f452bc7 Mon Sep 17 00:00:00 2001
 From: Michael Buch <[email protected]>
-Date: Fri, 25 May 2018 00:02:40 +0100
-Subject: [PATCH] [st patch] Add ability to open clipboard with configured
- program
+Date: Sat, 2 Feb 2019 15:07:21 +0000
+Subject: [PATCH] 0.8.1 port
 
-Lets user define a program to run in config.h and uses contents
-of CLIPBOARD selection to pass as a parameter. This can be bound
-to any key. By default binds Mod+o to opening the default
-browser.
 ---
  config.def.h |  1 +
  st.h         |  1 +
- x.c          | 22 ++++++++++++++++++++++
- 3 files changed, 24 insertions(+)
+ x.c          | 23 +++++++++++++++++++++++
+ 3 files changed, 25 insertions(+)
 
 diff --git a/config.def.h b/config.def.h
 index 82b1b09..83627db 100644
@@ -27,22 +22,22 @@ index 82b1b09..83627db 100644
  
  /*
 diff --git a/st.h b/st.h
-index dac64d8..773eeb3 100644
+index dac64d8..762938e 100644
 --- a/st.h
 +++ b/st.h
-@@ -81,6 +81,7 @@ void redraw(void);
+@@ -80,6 +80,7 @@ void die(const char *, ...);
+ void redraw(void);
  void draw(void);
  
- void iso14755(const Arg *);
 +void opencopied(const Arg *);
+ void iso14755(const Arg *);
  void printscreen(const Arg *);
  void printsel(const Arg *);
- void sendbreak(const Arg *);
 diff --git a/x.c b/x.c
-index c0bd890..b7edc5e 100644
+index c343ba2..3dfe122 100644
 --- a/x.c
 +++ b/x.c
-@@ -1949,3 +1949,25 @@ run:
+@@ -1950,3 +1950,26 @@ run:
  
        return 0;
  }
@@ -57,17 +52,18 @@ index c0bd890..b7edc5e 100644
 +              return;
 +      }
 +
-+      /* account for space/quote (3) and -+   char cmd[max_cmd + strlen(clip) 
+ 4];
++      /* account for space/quote (3) and ++   char cmd[max_cmd + strlen(clip) 
+ 5];
 +      strncpy(cmd, (char *)arg->v, max_cmd);
 +      cmd[max_cmd] = ' +
 +      strcat(cmd, " \"");
 +      strcat(cmd, clip);
 +      strcat(cmd, "\"");
++      strcat(cmd, "&");
 +
 +      system(cmd);
 +}
 -- 
-2.17.0
+2.20.1
 
diff --git 
a/st.suckless.org/patches/open_copied_url/st-openclipboard-20190202-3be4cf1.diff
 
b/st.suckless.org/patches/open_copied_url/st-openclipboard-20190202-3be4cf1.diff
new file mode 100644
index 00000000..5c9dd465
--- /dev/null
+++ 
b/st.suckless.org/patches/open_copied_url/st-openclipboard-20190202-3be4cf1.diff
@@ -0,0 +1,65 @@
+From 8a3e3d9f0de95c55321761e2763cf43666da312d Mon Sep 17 00:00:00 2001
+From: Michael Buch <[email protected]>
+Date: Sat, 2 Feb 2019 14:52:56 +0000
+Subject: [PATCH] Add ability to open clipboard with configured program
+
+---
+ config.def.h |  1 +
+ st.h         |  1 +
+ x.c          | 19 +++++++++++++++++++
+ 3 files changed, 21 insertions(+)
+
+diff --git a/config.def.h b/config.def.h
+index 0e01717..c273252 100644
+--- a/config.def.h
++++ b/config.def.h
+@@ -178,6 +178,7 @@ static Shortcut shortcuts[] = {
+       { TERMMOD,              XK_Y,           selpaste,       {.i =  0} },
+       { ShiftMask,            XK_Insert,      selpaste,       {.i =  0} },
+       { TERMMOD,              XK_Num_Lock,    numlock,        {.i =  0} },
++      { MODKEY,               XK_o,           opencopied,     {.v = 
"xdg-open"} },
+ };
+ 
+ /*
+diff --git a/st.h b/st.h
+index 38c61c4..a0d7a83 100644
+--- a/st.h
++++ b/st.h
+@@ -80,6 +80,7 @@ void die(const char *, ...);
+ void redraw(void);
+ void draw(void);
+ 
++void opencopied(const Arg *);
+ void printscreen(const Arg *);
+ void printsel(const Arg *);
+ void sendbreak(const Arg *);
+diff --git a/x.c b/x.c
+index 0422421..af75e85 100644
+--- a/x.c
++++ b/x.c
+@@ -1953,3 +1953,22 @@ run:
+ 
+       return 0;
+ }
++
++void
++opencopied(const Arg *arg)
++{
++      size_t const max_cmd = 2048;
++      char * const clip = xsel.clipboard;
++      if(!clip) {
++              fprintf(stderr, "Warning: nothing copied to clipboard
");
++              return;
++      }
++
++      /* account for space/quote (3) and ++   /* e.g.: xdg-open 
"https://st.suckless.org"&; */
++      size_t const cmd_size = max_cmd + strlen(clip) + 5;
++      char cmd[cmd_size];
++
++      snprintf(cmd, cmd_size, "%s \"%s\"&", (char *)arg->v, clip);
++      system(cmd);
++}
+-- 
+2.20.1
+


Reply via email to