Simplify patch to fix negative values in scrollh()/scrollv() - pkgsrc-localpatches - leot's pkgsrc LOCALPATCHES
 (HTM) hg clone https://bitbucket.org/iamleot/pkgsrc-localpatches
 (DIR) Log
 (DIR) Files
 (DIR) Refs
       ---
 (DIR) changeset d27a0a611cbcff0b5be207a415fd43da7a7badec
 (DIR) parent 634a66cfbb4997180e2b5ec5a03ffd7afa375153
 (HTM) Author: Leonardo Taccari <iamleot@gmail.com>
       Date:   Tue, 25 Jun 2019 01:38:38 
       
       Simplify patch to fix negative values in scrollh()/scrollv()
       
       Diffstat:
        wip/surf-git/patch-libsurf-webext.c |  16 +++++-----------
        wip/surf-git/patch-surf.c           |  11 -----------
        2 files changed, 5 insertions(+), 22 deletions(-)
       ---
       diff -r 634a66cfbb49 -r d27a0a611cbc wip/surf-git/patch-libsurf-webext.c
       --- a/wip/surf-git/patch-libsurf-webext.c       Tue Jun 25 01:36:45 2019 +0200
       +++ b/wip/surf-git/patch-libsurf-webext.c       Tue Jun 25 01:38:38 2019 +0200
       @@ -1,29 +1,23 @@
        $NetBSD$
        
       -Address negative values.
       +Fix negative values in readpipe()
        
        --- libsurf-webext.c.orig      2019-06-12 11:50:12.000000000 +0000
        +++ libsurf-webext.c
       -@@ -87,18 +87,18 @@ readpipe(GIOChannel *s, GIOCondition c, 
       - 
       -       switch (msg[2]) {
       -       case 'h':
       --              if (msgsz != 4)
       -+              if (msgsz != 5)
       +@@ -91,14 +91,14 @@ readpipe(GIOChannel *s, GIOCondition c, 
                               return TRUE;
                       ww = webkit_dom_dom_window_get_inner_width(view);
                       webkit_dom_dom_window_scroll_by(view,
        -                                              (ww / 100) * msg[3], 0);
       -+                  (ww / 100) * (msg[3] == '-' ? -1 : +1) * msg[4], 0);
       ++                                              (ww / 100) * (signed char)msg[3], 0);
                       break;
               case 'v':
       --              if (msgsz != 4)
       -+              if (msgsz != 5)
       +               if (msgsz != 4)
                               return TRUE;
                       wh = webkit_dom_dom_window_get_inner_height(view);
                       webkit_dom_dom_window_scroll_by(view,
        -                                              0, (wh / 100) * msg[3]);
       -+                  0, (wh / 100) * (msg[3] == '-' ? -1 : +1) * msg[4]);
       ++                                              0, (wh / 100) * (signed char)msg[3]);
                       break;
               }
         
       diff -r 634a66cfbb49 -r d27a0a611cbc wip/surf-git/patch-surf.c
       --- a/wip/surf-git/patch-surf.c Tue Jun 25 01:36:45 2019 +0200
       +++ b/wip/surf-git/patch-surf.c Tue Jun 25 01:38:38 2019 +0200
       @@ -164,17 +164,6 @@
                               webkit_settings_set_user_agent(settings, fulluseragent);
                       } else if (surfuseragent) {
                               webkit_settings_set_user_agent_with_application_details(
       -@@ -1848,8 +1918,8 @@ msgext(Client *c, char type, const Arg *
       -       static char msg[MSGBUFSZ];
       -       int ret;
       - 
       --      if ((ret = snprintf(msg, sizeof(msg), "%c%c%c%c",
       --                          4, c->pageid, type, a->i))
       -+      if ((ret = snprintf(msg, sizeof(msg), "%c%c%c%c%c",
       -+                          5, c->pageid, type, a->i >= 0 ? '+' : '-', abs(a->i)))
       -           >= sizeof(msg)) {
       -               fprintf(stderr, "surf: message too long: %d\n", ret);
       -               return;
        @@ -1971,6 +2041,15 @@ clickexternplayer(Client *c, const Arg *
               spawn(c, &arg);
         }