code:
Remove options and code to use bitmaps of the BSD daemon and other characters
with copyright issues. The bitmaps themselves are deleted in a source snippet.
diff --git a/cursors/cursor.include b/cursors/cursor.include
index ef96d72..1dc3dc2 100644
--- a/cursors/cursor.include
+++ b/cursors/cursor.include
@@ -2,9 +2,3 @@
 #include "mouse_cursor_mask.xbm"
 #include "bone_cursor.xbm"
 #include "bone_cursor_mask.xbm"
-#include "bsd_cursor.xbm"
-#include "bsd_cursor_mask.xbm"
-#include "card_cursor.xbm"
-#include "card_cursor_mask.xbm"
-#include "petal_cursor.xbm"
-#include "petal_cursor_mask.xbm"
diff --git a/oneko.c b/oneko.c
index d2b81fe..04fa59f 100644
--- a/oneko.c
+++ b/oneko.c
@@ -33,7 +33,7 @@ XColor	theBackgroundColor;		/* $@?'(J ($@%P%C%/%0%i%&%s%I(J) */

 int Synchronous = False;
 /* Types of animals */
-#define BITMAPTYPES 6
+#define BITMAPTYPES 3
 typedef struct _AnimalDefaults {
   char *name;
   int speed, idle, bitmap_width, bitmap_height;
@@ -51,12 +51,6 @@ AnimalDefaultsData AnimalDefaultsDataTable[] =
       mouse_cursor_width,mouse_cursor_height, mouse_cursor_x_hot,mouse_cursor_y_hot },
   { "dog" , 10, 6, 32, 32, 125000L, 0, 0, bone_cursor_bits,bone_cursor_mask_bits,
       bone_cursor_width,bone_cursor_height, bone_cursor_x_hot,bone_cursor_y_hot },
-  { "bsd_daemon" , 16, 6, 32, 32, 300000L, 22, 20, bsd_cursor_bits,bsd_cursor_mask_bits,
-      bsd_cursor_width,bsd_cursor_height, bsd_cursor_x_hot,bsd_cursor_y_hot },
-  { "sakura" , 13, 6, 32, 32, 125000L, 0, 0, card_cursor_bits,card_cursor_mask_bits,
-      card_cursor_width,card_cursor_height, card_cursor_x_hot,card_cursor_y_hot },
-  { "tomoyo" , 10, 6, 32, 32, 125000L, 32, 32, petal_cursor_bits,petal_cursor_mask_bits,
-      petal_cursor_width,petal_cursor_height, petal_cursor_x_hot,petal_cursor_y_hot },
 };

 /*
@@ -154,70 +148,70 @@ typedef struct {

 BitmapGCData	BitmapGCDataTable[] =
 {
-    { &Mati2GC, &Mati2Xbm,  mati2_bits, mati2_tora_bits, mati2_dog_bits, mati2_bsd_bits, mati2_sakura_bits, mati2_tomoyo_bits,
-      &Mati2Msk, mati2_mask_bits, mati2_mask_bits, mati2_dog_mask_bits, mati2_bsd_mask_bits, mati2_sakura_mask_bits, mati2_tomoyo_mask_bits },
-    { &Jare2GC, &Jare2Xbm,  jare2_bits, jare2_tora_bits, jare2_dog_bits, jare2_bsd_bits, jare2_sakura_bits, jare2_tomoyo_bits,
-      &Jare2Msk, jare2_mask_bits, jare2_mask_bits, jare2_dog_mask_bits, jare2_bsd_mask_bits, jare2_sakura_mask_bits, jare2_tomoyo_mask_bits },
-    { &Kaki1GC, &Kaki1Xbm,  kaki1_bits, kaki1_tora_bits, kaki1_dog_bits, kaki1_bsd_bits, kaki1_sakura_bits, kaki1_tomoyo_bits,
-      &Kaki1Msk, kaki1_mask_bits, kaki1_mask_bits, kaki1_dog_mask_bits, kaki1_bsd_mask_bits, kaki1_sakura_mask_bits, kaki1_tomoyo_mask_bits },
-    { &Kaki2GC, &Kaki2Xbm,  kaki2_bits, kaki2_tora_bits, kaki2_dog_bits, kaki2_bsd_bits, kaki2_sakura_bits, kaki2_tomoyo_bits,
-      &Kaki2Msk, kaki2_mask_bits, kaki2_mask_bits, kaki2_dog_mask_bits, kaki2_bsd_mask_bits, kaki2_sakura_mask_bits, kaki2_tomoyo_mask_bits },
-    { &Mati3GC, &Mati3Xbm,  mati3_bits, mati3_tora_bits, mati3_dog_bits, mati3_bsd_bits, mati3_sakura_bits, mati3_tomoyo_bits,
-      &Mati3Msk, mati3_mask_bits, mati3_mask_bits, mati3_dog_mask_bits, mati3_bsd_mask_bits, mati3_sakura_mask_bits, mati3_tomoyo_mask_bits },
-    { &Sleep1GC, &Sleep1Xbm,  sleep1_bits, sleep1_tora_bits, sleep1_dog_bits, sleep1_bsd_bits, sleep1_sakura_bits, sleep1_tomoyo_bits,
-      &Sleep1Msk, sleep1_mask_bits, sleep1_mask_bits, sleep1_dog_mask_bits, sleep1_bsd_mask_bits, sleep1_sakura_mask_bits, sleep1_tomoyo_mask_bits },
-    { &Sleep2GC, &Sleep2Xbm,  sleep2_bits, sleep2_tora_bits, sleep2_dog_bits, sleep2_bsd_bits, sleep2_sakura_bits, sleep2_tomoyo_bits,
-      &Sleep2Msk, sleep2_mask_bits, sleep2_mask_bits, sleep2_dog_mask_bits, sleep2_bsd_mask_bits, sleep2_sakura_mask_bits, sleep2_tomoyo_mask_bits },
-    { &AwakeGC, &AwakeXbm,  awake_bits, awake_tora_bits, awake_dog_bits, awake_bsd_bits, awake_sakura_bits, awake_tomoyo_bits,
-      &AwakeMsk, awake_mask_bits, awake_mask_bits, awake_dog_mask_bits, awake_bsd_mask_bits, awake_sakura_mask_bits, awake_tomoyo_mask_bits },
-    { &Up1GC, &Up1Xbm,  up1_bits, up1_tora_bits, up1_dog_bits, up1_bsd_bits, up1_sakura_bits, up1_tomoyo_bits,
-      &Up1Msk, up1_mask_bits, up1_mask_bits, up1_dog_mask_bits, up1_bsd_mask_bits, up1_sakura_mask_bits, up1_tomoyo_mask_bits },
-    { &Up2GC, &Up2Xbm,  up2_bits, up2_tora_bits, up2_dog_bits, up2_bsd_bits, up2_sakura_bits, up2_tomoyo_bits,
-      &Up2Msk, up2_mask_bits, up2_mask_bits, up2_dog_mask_bits, up2_bsd_mask_bits, up2_sakura_mask_bits, up2_tomoyo_mask_bits },
-    { &Down1GC, &Down1Xbm,  down1_bits, down1_tora_bits, down1_dog_bits, down1_bsd_bits, down1_sakura_bits, down1_tomoyo_bits,
-      &Down1Msk, down1_mask_bits, down1_mask_bits, down1_dog_mask_bits, down1_bsd_mask_bits, down1_sakura_mask_bits, down1_tomoyo_mask_bits },
-    { &Down2GC, &Down2Xbm,  down2_bits, down2_tora_bits, down2_dog_bits, down2_bsd_bits, down2_sakura_bits, down2_tomoyo_bits,
-      &Down2Msk, down2_mask_bits, down2_mask_bits, down2_dog_mask_bits, down2_bsd_mask_bits, down2_sakura_mask_bits, down2_tomoyo_mask_bits },
-    { &Left1GC, &Left1Xbm,  left1_bits, left1_tora_bits, left1_dog_bits, left1_bsd_bits, left1_sakura_bits, left1_tomoyo_bits,
-      &Left1Msk, left1_mask_bits, left1_mask_bits, left1_dog_mask_bits, left1_bsd_mask_bits, left1_sakura_mask_bits, left1_tomoyo_mask_bits },
-    { &Left2GC, &Left2Xbm,  left2_bits, left2_tora_bits, left2_dog_bits, left2_bsd_bits, left2_sakura_bits, left2_tomoyo_bits,
-      &Left2Msk, left2_mask_bits, left2_mask_bits, left2_dog_mask_bits, left2_bsd_mask_bits, left2_sakura_mask_bits, left2_tomoyo_mask_bits },
-    { &Right1GC, &Right1Xbm,  right1_bits, right1_tora_bits, right1_dog_bits, right1_bsd_bits, right1_sakura_bits, right1_tomoyo_bits,
-      &Right1Msk, right1_mask_bits, right1_mask_bits,right1_dog_mask_bits, right1_bsd_mask_bits, right1_sakura_mask_bits, right1_tomoyo_mask_bits },
-    { &Right2GC, &Right2Xbm,  right2_bits, right2_tora_bits, right2_dog_bits, right2_bsd_bits, right2_sakura_bits, right2_tomoyo_bits,
-      &Right2Msk, right2_mask_bits, right2_mask_bits, right2_dog_mask_bits, right2_bsd_mask_bits, right2_sakura_mask_bits, right2_tomoyo_mask_bits },
-    { &UpLeft1GC, &UpLeft1Xbm,  upleft1_bits, upleft1_tora_bits, upleft1_dog_bits, upleft1_bsd_bits, upleft1_sakura_bits, upleft1_tomoyo_bits,
-      &UpLeft1Msk, upleft1_mask_bits, upleft1_mask_bits, upleft1_dog_mask_bits, upleft1_bsd_mask_bits, upleft1_sakura_mask_bits, upleft1_tomoyo_mask_bits },
-    { &UpLeft2GC, &UpLeft2Xbm,  upleft2_bits, upleft2_tora_bits, upleft2_dog_bits, upleft2_bsd_bits, upleft2_sakura_bits, upleft2_tomoyo_bits,
-      &UpLeft2Msk, upleft2_mask_bits, upleft2_mask_bits,upleft2_dog_mask_bits, upleft2_bsd_mask_bits, upleft2_sakura_mask_bits, upleft2_tomoyo_mask_bits },
-    { &UpRight1GC, &UpRight1Xbm,  upright1_bits, upright1_tora_bits, upright1_dog_bits, upright1_bsd_bits, upright1_sakura_bits, upright1_tomoyo_bits,
-      &UpRight1Msk, upright1_mask_bits, upright1_mask_bits,upright1_dog_mask_bits, upright1_bsd_mask_bits, upright1_sakura_mask_bits, upright1_tomoyo_mask_bits },
-    { &UpRight2GC, &UpRight2Xbm,  upright2_bits, upright2_tora_bits, upright2_dog_bits, upright2_bsd_bits, upright2_sakura_bits, upright2_tomoyo_bits,
-      &UpRight2Msk, upright2_mask_bits, upright2_mask_bits,upright2_dog_mask_bits, upright2_bsd_mask_bits, upright2_sakura_mask_bits, upright2_tomoyo_mask_bits },
-    { &DownLeft1GC, &DownLeft1Xbm,  dwleft1_bits, dwleft1_tora_bits, dwleft1_dog_bits, dwleft1_bsd_bits, dwleft1_sakura_bits, dwleft1_tomoyo_bits,
-      &DownLeft1Msk, dwleft1_mask_bits, dwleft1_mask_bits, dwleft1_dog_mask_bits, dwleft1_bsd_mask_bits, dwleft1_sakura_mask_bits, dwleft1_tomoyo_mask_bits },
-    { &DownLeft2GC, &DownLeft2Xbm,  dwleft2_bits, dwleft2_tora_bits, dwleft2_dog_bits, dwleft2_bsd_bits, dwleft2_sakura_bits, dwleft2_tomoyo_bits,
-      &DownLeft2Msk, dwleft2_mask_bits, dwleft2_mask_bits, dwleft2_dog_mask_bits, dwleft2_bsd_mask_bits, dwleft2_sakura_mask_bits, dwleft2_tomoyo_mask_bits },
-    { &DownRight1GC, &DownRight1Xbm,  dwright1_bits, dwright1_tora_bits, dwright1_dog_bits, dwright1_bsd_bits, dwright1_sakura_bits, dwright1_tomoyo_bits,
-      &DownRight1Msk, dwright1_mask_bits, dwright1_mask_bits, dwright1_dog_mask_bits, dwright1_bsd_mask_bits, dwright1_sakura_mask_bits, dwright1_tomoyo_mask_bits },
-    { &DownRight2GC, &DownRight2Xbm,  dwright2_bits, dwright2_tora_bits, dwright2_dog_bits, dwright2_bsd_bits, dwright2_sakura_bits, dwright2_tomoyo_bits,
-      &DownRight2Msk, dwright2_mask_bits, dwright2_mask_bits, dwright2_dog_mask_bits, dwright2_bsd_mask_bits, dwright2_sakura_mask_bits, dwright2_tomoyo_mask_bits },
-    { &UpTogi1GC, &UpTogi1Xbm,  utogi1_bits, utogi1_tora_bits, utogi1_dog_bits, utogi1_bsd_bits, utogi1_sakura_bits, utogi1_tomoyo_bits,
-      &UpTogi1Msk, utogi1_mask_bits, utogi1_mask_bits, utogi1_dog_mask_bits, utogi1_bsd_mask_bits, utogi1_sakura_mask_bits, utogi1_tomoyo_mask_bits },
-    { &UpTogi2GC, &UpTogi2Xbm,  utogi2_bits, utogi2_tora_bits, utogi2_dog_bits, utogi2_bsd_bits, utogi2_sakura_bits, utogi2_tomoyo_bits,
-      &UpTogi2Msk, utogi2_mask_bits, utogi2_mask_bits, utogi2_dog_mask_bits, utogi2_bsd_mask_bits, utogi2_sakura_mask_bits, utogi2_tomoyo_mask_bits },
-    { &DownTogi1GC, &DownTogi1Xbm,  dtogi1_bits, dtogi1_tora_bits, dtogi1_dog_bits, dtogi1_bsd_bits, dtogi1_sakura_bits, dtogi1_tomoyo_bits,
-      &DownTogi1Msk, dtogi1_mask_bits, dtogi1_mask_bits, dtogi1_dog_mask_bits, dtogi1_bsd_mask_bits, dtogi1_sakura_mask_bits, dtogi1_tomoyo_mask_bits },
-    { &DownTogi2GC, &DownTogi2Xbm,  dtogi2_bits, dtogi2_tora_bits, dtogi2_dog_bits, dtogi2_bsd_bits, dtogi2_sakura_bits, dtogi2_tomoyo_bits,
-      &DownTogi2Msk, dtogi2_mask_bits, dtogi2_mask_bits, dtogi2_dog_mask_bits, dtogi2_bsd_mask_bits, dtogi2_sakura_mask_bits, dtogi2_tomoyo_mask_bits },
-    { &LeftTogi1GC, &LeftTogi1Xbm,  ltogi1_bits, ltogi1_tora_bits, ltogi1_dog_bits, ltogi1_bsd_bits, ltogi1_sakura_bits, ltogi1_tomoyo_bits,
-      &LeftTogi1Msk, ltogi1_mask_bits, ltogi1_mask_bits,ltogi1_dog_mask_bits, ltogi1_bsd_mask_bits, ltogi1_sakura_mask_bits, ltogi1_tomoyo_mask_bits },
-    { &LeftTogi2GC, &LeftTogi2Xbm,  ltogi2_bits, ltogi2_tora_bits, ltogi2_dog_bits, ltogi2_bsd_bits, ltogi2_sakura_bits, ltogi2_tomoyo_bits,
-      &LeftTogi2Msk, ltogi2_mask_bits, ltogi2_mask_bits,ltogi2_dog_mask_bits, ltogi2_bsd_mask_bits, ltogi2_sakura_mask_bits, ltogi2_tomoyo_mask_bits },
-    { &RightTogi1GC, &RightTogi1Xbm,  rtogi1_bits, rtogi1_tora_bits, rtogi1_dog_bits, rtogi1_bsd_bits, rtogi1_sakura_bits, rtogi1_tomoyo_bits,
-      &RightTogi1Msk, rtogi1_mask_bits, rtogi1_mask_bits,rtogi1_dog_mask_bits, rtogi1_bsd_mask_bits, rtogi1_sakura_mask_bits, rtogi1_tomoyo_mask_bits },
-    { &RightTogi2GC, &RightTogi2Xbm,  rtogi2_bits, rtogi2_tora_bits, rtogi2_dog_bits, rtogi2_bsd_bits, rtogi2_sakura_bits, rtogi2_tomoyo_bits,
-      &RightTogi2Msk, rtogi2_mask_bits, rtogi2_mask_bits,rtogi2_dog_mask_bits, rtogi2_bsd_mask_bits, rtogi2_sakura_mask_bits, rtogi2_tomoyo_mask_bits },
+    { &Mati2GC, &Mati2Xbm,  mati2_bits, mati2_tora_bits, mati2_dog_bits,
+      &Mati2Msk, mati2_mask_bits, mati2_mask_bits, mati2_dog_mask_bits },
+    { &Jare2GC, &Jare2Xbm,  jare2_bits, jare2_tora_bits, jare2_dog_bits,
+      &Jare2Msk, jare2_mask_bits, jare2_mask_bits, jare2_dog_mask_bits },
+    { &Kaki1GC, &Kaki1Xbm,  kaki1_bits, kaki1_tora_bits, kaki1_dog_bits,
+      &Kaki1Msk, kaki1_mask_bits, kaki1_mask_bits, kaki1_dog_mask_bits },
+    { &Kaki2GC, &Kaki2Xbm,  kaki2_bits, kaki2_tora_bits, kaki2_dog_bits,
+      &Kaki2Msk, kaki2_mask_bits, kaki2_mask_bits, kaki2_dog_mask_bits },
+    { &Mati3GC, &Mati3Xbm,  mati3_bits, mati3_tora_bits, mati3_dog_bits,
+      &Mati3Msk, mati3_mask_bits, mati3_mask_bits, mati3_dog_mask_bits },
+    { &Sleep1GC, &Sleep1Xbm,  sleep1_bits, sleep1_tora_bits, sleep1_dog_bits,
+      &Sleep1Msk, sleep1_mask_bits, sleep1_mask_bits, sleep1_dog_mask_bits },
+    { &Sleep2GC, &Sleep2Xbm,  sleep2_bits, sleep2_tora_bits, sleep2_dog_bits,
+      &Sleep2Msk, sleep2_mask_bits, sleep2_mask_bits, sleep2_dog_mask_bits },
+    { &AwakeGC, &AwakeXbm,  awake_bits, awake_tora_bits, awake_dog_bits,
+      &AwakeMsk, awake_mask_bits, awake_mask_bits, awake_dog_mask_bits },
+    { &Up1GC, &Up1Xbm,  up1_bits, up1_tora_bits, up1_dog_bits,
+      &Up1Msk, up1_mask_bits, up1_mask_bits, up1_dog_mask_bits },
+    { &Up2GC, &Up2Xbm,  up2_bits, up2_tora_bits, up2_dog_bits,
+      &Up2Msk, up2_mask_bits, up2_mask_bits, up2_dog_mask_bits },
+    { &Down1GC, &Down1Xbm,  down1_bits, down1_tora_bits, down1_dog_bits,
+      &Down1Msk, down1_mask_bits, down1_mask_bits, down1_dog_mask_bits },
+    { &Down2GC, &Down2Xbm,  down2_bits, down2_tora_bits, down2_dog_bits,
+      &Down2Msk, down2_mask_bits, down2_mask_bits, down2_dog_mask_bits },
+    { &Left1GC, &Left1Xbm,  left1_bits, left1_tora_bits, left1_dog_bits,
+      &Left1Msk, left1_mask_bits, left1_mask_bits, left1_dog_mask_bits },
+    { &Left2GC, &Left2Xbm,  left2_bits, left2_tora_bits, left2_dog_bits,
+      &Left2Msk, left2_mask_bits, left2_mask_bits, left2_dog_mask_bits },
+    { &Right1GC, &Right1Xbm,  right1_bits, right1_tora_bits, right1_dog_bits,
+      &Right1Msk, right1_mask_bits, right1_mask_bits,right1_dog_mask_bits },
+    { &Right2GC, &Right2Xbm,  right2_bits, right2_tora_bits, right2_dog_bits,
+      &Right2Msk, right2_mask_bits, right2_mask_bits, right2_dog_mask_bits },
+    { &UpLeft1GC, &UpLeft1Xbm,  upleft1_bits, upleft1_tora_bits, upleft1_dog_bits,
+      &UpLeft1Msk, upleft1_mask_bits, upleft1_mask_bits, upleft1_dog_mask_bits },
+    { &UpLeft2GC, &UpLeft2Xbm,  upleft2_bits, upleft2_tora_bits, upleft2_dog_bits,
+      &UpLeft2Msk, upleft2_mask_bits, upleft2_mask_bits,upleft2_dog_mask_bits },
+    { &UpRight1GC, &UpRight1Xbm,  upright1_bits, upright1_tora_bits, upright1_dog_bits,
+      &UpRight1Msk, upright1_mask_bits, upright1_mask_bits,upright1_dog_mask_bits },
+    { &UpRight2GC, &UpRight2Xbm,  upright2_bits, upright2_tora_bits, upright2_dog_bits,
+      &UpRight2Msk, upright2_mask_bits, upright2_mask_bits,upright2_dog_mask_bits },
+    { &DownLeft1GC, &DownLeft1Xbm,  dwleft1_bits, dwleft1_tora_bits, dwleft1_dog_bits,
+      &DownLeft1Msk, dwleft1_mask_bits, dwleft1_mask_bits, dwleft1_dog_mask_bits },
+    { &DownLeft2GC, &DownLeft2Xbm,  dwleft2_bits, dwleft2_tora_bits, dwleft2_dog_bits,
+      &DownLeft2Msk, dwleft2_mask_bits, dwleft2_mask_bits, dwleft2_dog_mask_bits },
+    { &DownRight1GC, &DownRight1Xbm,  dwright1_bits, dwright1_tora_bits, dwright1_dog_bits,
+      &DownRight1Msk, dwright1_mask_bits, dwright1_mask_bits, dwright1_dog_mask_bits },
+    { &DownRight2GC, &DownRight2Xbm,  dwright2_bits, dwright2_tora_bits, dwright2_dog_bits,
+      &DownRight2Msk, dwright2_mask_bits, dwright2_mask_bits, dwright2_dog_mask_bits },
+    { &UpTogi1GC, &UpTogi1Xbm,  utogi1_bits, utogi1_tora_bits, utogi1_dog_bits,
+      &UpTogi1Msk, utogi1_mask_bits, utogi1_mask_bits, utogi1_dog_mask_bits },
+    { &UpTogi2GC, &UpTogi2Xbm,  utogi2_bits, utogi2_tora_bits, utogi2_dog_bits,
+      &UpTogi2Msk, utogi2_mask_bits, utogi2_mask_bits, utogi2_dog_mask_bits },
+    { &DownTogi1GC, &DownTogi1Xbm,  dtogi1_bits, dtogi1_tora_bits, dtogi1_dog_bits,
+      &DownTogi1Msk, dtogi1_mask_bits, dtogi1_mask_bits, dtogi1_dog_mask_bits },
+    { &DownTogi2GC, &DownTogi2Xbm,  dtogi2_bits, dtogi2_tora_bits, dtogi2_dog_bits,
+      &DownTogi2Msk, dtogi2_mask_bits, dtogi2_mask_bits, dtogi2_dog_mask_bits },
+    { &LeftTogi1GC, &LeftTogi1Xbm,  ltogi1_bits, ltogi1_tora_bits, ltogi1_dog_bits,
+      &LeftTogi1Msk, ltogi1_mask_bits, ltogi1_mask_bits,ltogi1_dog_mask_bits },
+    { &LeftTogi2GC, &LeftTogi2Xbm,  ltogi2_bits, ltogi2_tora_bits, ltogi2_dog_bits,
+      &LeftTogi2Msk, ltogi2_mask_bits, ltogi2_mask_bits,ltogi2_dog_mask_bits },
+    { &RightTogi1GC, &RightTogi1Xbm,  rtogi1_bits, rtogi1_tora_bits, rtogi1_dog_bits,
+      &RightTogi1Msk, rtogi1_mask_bits, rtogi1_mask_bits,rtogi1_dog_mask_bits },
+    { &RightTogi2GC, &RightTogi2Xbm,  rtogi2_bits, rtogi2_tora_bits, rtogi2_dog_bits,
+      &RightTogi2Msk, rtogi2_mask_bits, rtogi2_mask_bits,rtogi2_dog_mask_bits },
     { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }
 };

@@ -1512,8 +1506,6 @@ GetArguments(argc, argv, theDisplayName)
     }
     else {
       char *av = argv[ArgCounter] + 1;
-      if (strcmp(av, "bsd") == 0)
-	av = "bsd_daemon";
       for (loop=0;loop<BITMAPTYPES;loop++) {
 	if (strcmp(av,AnimalDefaultsDataTable[loop].name)==0)
 	  {NekoMoyou = loop;found=1;}
diff --git a/oneko.h b/oneko.h
index 414e12f..38281fd 100644
--- a/oneko.h
+++ b/oneko.h
@@ -36,17 +36,11 @@
 #include "bitmaps/neko/neko.include"
 #include "bitmaps/tora/tora.include"
 #include "bitmaps/dog/dog.include"
-#include "bitmaps/bsd/bsd.include"
-#include "bitmaps/sakura/sakura.include"
-#include "bitmaps/tomoyo/tomoyo.include"

 /* These are the bitmasks that allow the use of the shape extension. */

 #include "bitmasks/neko/neko.mask.include"
 #include "bitmasks/dog/dog.mask.include"
-#include "bitmasks/bsd/bsd.mask.include"
-#include "bitmasks/sakura/sakura.mask.include"
-#include "bitmasks/tomoyo/tomoyo.mask.include"

 /*
  *	$@Dj?tDj5A(J
diff --git a/oneko.man b/oneko.man
index d6d2b40..0e9b09d 100644
--- a/oneko.man
+++ b/oneko.man
@@ -3,9 +3,7 @@
 The program oneko creates a cute cat chasing around your mouse cursor.
 .SH SYNOPSIS
 .B oneko
-[\fB-help\fP] [\fB-tora\fP]
-[\fB-dog\fP] [\fB-bsd_daemon\fP] [\fB-bsd\fP]
-[\fB-sakura\fP] [\fB-tomoyo\fP]
+[\fB-help\fP] [\fB-tora\fP] [\fB-dog\fP]
 [\fB-time\fP \fIn\fP] [\fB-speed\fP \fIn\fP] [\fB-idle\fP \fIn\fP]
 [\fB-name\fP \fIname\fP] [\fB-towindow\fP] [\fB-toname\fP \fIname\fP]
 [\fB-tofocus\fP]
@@ -28,19 +26,6 @@ I don't know how to say it in English.
 .B -dog
 Runs a dog instead of a cat.
 .TP
-.B -bsd_daemon
-Runs a 4.3BSD daemon instead of a cat.
-.TP
-.B -bsd
-Same as
-.B -bsd_daemon.
-.TP
-.B -sakura
-Runs Sakura Kinomoto instead of a cat.
-.TP
-.B -tomoyo
-Runs Tomoyo Daidouji instead of a cat.
-.TP
 .BI \-time " interval"
 Sets interval timer which determine intervals for cat animation.
 Default value is 125000 and unit is micro-second.  Smaller value makes cat
@@ -129,12 +114,6 @@ Background color.
 While this program uses XGetDefault, be sure to use "neko.resouce" form.
 If you run this program as "tora", by hard of soft link, the \fB-tora\fP
 option is enabled by default.
-.PP
-BSD Daemon Copyright 1988 by Marshall Kirk McKusick. All Rights Reserved.
-.PP
-Sakura Kinomoto and Tomoyo Daidouji are characters in a comic strip
-"CARDCAPTOR SAKURA" (CLAMP, Kodansha), with the sanction indicated in
-CLAMP SCHOOL WEB CAMPUS (http://www.clamp.f-2.co.jp/).
 .SH AUTHOR
 Original
 .I xneko
diff --git a/oneko.man.jp b/oneko.man.jp
index 96f9e3a..9a885df 100644
--- a/oneko.man.jp
+++ b/oneko.man.jp
@@ -3,9 +3,7 @@
 $@$+$o$$$$G-$,%^%&%9%+!<%=%k$rDI$$$+$1$k%W%m%0%i%`(J
 .SH $@=q<0(J
 .B oneko
-[\fB-help\fP] [\fB-tora\fP]
-[\fB-dog\fP] [\fB-bsd_daemon\fP] [\fB-bsd\fP]
-[\fB-sakura\fP] [\fB-tomoyo\fP]
+[\fB-help\fP] [\fB-tora\fP] [\fB-dog\fP]
 [\fB-time\fP \fIn\fP] [\fB-speed\fP \fIn\fP] [\fB-idle\fP \fIn\fP]
 [\fB-name\fP \fIname\fP] [\fB-towindow\fP] [\fB-toname\fP \fIname\fP]
 [\fB-tofocus\fP]
@@ -27,19 +25,6 @@
 .B -dog
 $@G-$KBe$o$j8$$,Av$j$^$9!#(J
 .TP
-.B -bsd_daemon
-$@G-$KBe$o$j(J 4.3BSD $@%G!<%b%s$,Av$j$^$9!#(J
-.TP
-.B -bsd
-.B -bsd_daemon
-$@$KF1$8!#(J
-.TP
-.B -sakura
-$@G-$KBe$o$jLZG7K\:y$,Av$j$^$9!#(J
-.TP
-.B -tomoyo
-$@G-$KBe$o$jBgF;;{CN@$$,Av$j$^$9!#(J
-.TP
 .BI \-time " interval"
 $@G-%"%K%a!<%7%g%s$N4V3V$r;XDj$7$^$9!#(J
 $@%G%U%)%k%HCM$O(J 125000 $@$GC10L$O%^%$%/%mIC$G$9!#(J
@@ -127,15 +112,6 @@ SHAPE extension $@$r;H$$$?$/$J$$>l9g(J True $@$H$7$^$9!#(J
 $@$r;H$&$3$H$KN10U$7$F$/$@$5$$!#(J
 $@%O!<%I%j%s%/$"$k$$$O%=%U%H%j%s%/$K$h$C$F!"$3$N%W%m%0%i%`$r(J tora $@$H$7$F(J
 $@5/F0$7$?>l9g$K$O!"%G%U%)%k%H$G(J \fB-tora\fP $@%*%W%7%g%s$,M-8z$H$J$j$^$9!#(J
-.PP
-BSD $@%G!<%b%s$O(J  Marshall Kirk McKusick $@;a$NCx:nJ*$G$9!#$9$Y$F$N8"Mx$O(J
-$@J];}$5$l$F$$$^$9!#(J
-BSD Daemon Copyright 1988 by Marshall Kirk McKusick. All Rights Reserved.
-.PP
-$@LZG7K\:y$*$h$SBgF;;{CN@$$OL!2h!X%+!<%I%-%c%W%?!<$5$/$i!Y!J(JCLAMP, $@9VCL(J
-$@<R!K$N%-%c%i%/%?!<$G$"$j!"(JCLAMP $@3X1`EE;RJ,9;(J
-$@!J(Jhttp://www.clamp.f-2.co.jp/$@!K$K<($5$l$F$$$kMFG'$N$b$H$KMxMQ$5$l$F$$(J
-$@$^$9!#(J
 .SH $@:n<T(J
 $@%*%j%8%J%k$N(J
 .I xneko


code:
Build against the system's HIDAPI instead of the bundled one.

--- open-zwave-1.6-checkout/cpp/build/support.mk	2019-06-16 15:15:34.258331628 +0200
+++ open-zwave-1.6-checkout/cpp/build/support.mk	2019-06-16 15:15:54.698249462 +0200
@@ -86,6 +86,10 @@ endif
 endif
 SED    := sed

+# Build against the system's HIDAPI.
+CPPFLAGS += $(shell pkg-config hidapi-libusb --cflags)
+LDFLAGS  += $(shell pkg-config hidapi-libusb --libs)
+
 #determine if we are release or debug Build and set appropriate flags
 ifeq ($(BUILD), release)
 CFLAGS	+= -c $(RELEASE_CFLAGS)

repo_name: maximed/guix

license: mit


code:
From 52cea818bf68f8a2d3c48d55d00c2f8b7da25e4c Mon Sep 17 00:00:00 2001
From: Daniel Hogan <daniel.hogan@usask.ca>
Date: Tue, 28 Mar 2017 22:21:18 -0600
Subject: [PATCH] Remove delete statement.

When from_scratch is true, coordinates is not allocated. A separate if
statement was added to handle the case when from_scratch is true that
does not try to free coordinates.
---
 src/formats/nwchemformat.cpp | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/formats/nwchemformat.cpp b/src/formats/nwchemformat.cpp
index 6f625ad5b..79298555f 100644
--- a/src/formats/nwchemformat.cpp
+++ b/src/formats/nwchemformat.cpp
@@ -232,11 +232,14 @@ static const char* OPTIMIZATION_END_PATTERN = "  Optimization converged";
           break;
         tokenize(vs,buffer);
     }
-    if ((from_scratch)||(i != natoms))
-      {
+    if (from_scratch)
+    {
+        return;
+    }
+    if (i != natoms) {
         delete[] coordinates;
         return;
-      }
+    }
     molecule->AddConformer(coordinates);
   }


code:
Fix build with glibc 2.26:

https://github.com/tpaviot/oce/issues/675

Patch copied from upstream source repository:

https://github.com/tpaviot/oce/commit/aa1321e68cc004e3debe38d79ae74581a617c767

From aa1321e68cc004e3debe38d79ae74581a617c767 Mon Sep 17 00:00:00 2001
From: Janus Weil <janus@gcc.gnu.org>
Date: Mon, 18 Dec 2017 11:27:55 +0100
Subject: [PATCH] fix build errors with glibc 2.26+ due to missing xlocale.h
 (issue #675)

* check for the presence of xlocale.h via cmake
* remove related logic from Standard_CLocaleSentry.hxx
---
 CMakeLists.txt                          |  1 +
 src/Standard/Standard_CLocaleSentry.hxx | 15 ---------------
 2 files changed, 1 insertion(+), 15 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index b782b4101..50e9500b2 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -616,6 +616,7 @@ if (NOT WIN32)
 	# compilation anywhere in OCE
 	include(CheckIncludeFile)
 	check_include_file(strings.h HAVE_STRINGS_H)
+	check_include_file(xlocale.h HAVE_XLOCALE_H)
 	include(CheckIncludeFileCXX)
 	check_include_file_cxx(mm_malloc.h HAVE_MM_MALLOC_H)
 	check_include_file_cxx(atomic.h OCE_HAVE_ATOMIC_H)
diff --git a/src/Standard/Standard_CLocaleSentry.hxx b/src/Standard/Standard_CLocaleSentry.hxx
index 2b226e7f3..1a4c1dadc 100644
--- a/src/Standard/Standard_CLocaleSentry.hxx
+++ b/src/Standard/Standard_CLocaleSentry.hxx
@@ -20,21 +20,6 @@

 #include <locale.h>

-#ifndef HAVE_XLOCALE_H
-  //! "xlocale.h" available in Mac OS X and glibc (Linux) for a long time as an extension
-  //! and become part of POSIX since '2008.
-  //! Notice that this is impossible to test (_POSIX_C_SOURCE >= 200809L)
-  //! since POSIX didn't declared such identifier.
-  #if defined(__APPLE__)
-    #define HAVE_XLOCALE_H
-  #endif
-
-  //! We check _GNU_SOURCE for glibc extensions here and it is always defined by g++ compiler.
-  #if defined(_GNU_SOURCE) && !defined(__ANDROID__)
-    #define HAVE_XLOCALE_H
-  #endif
-#endif // ifndef HAVE_LOCALE_H
-
 #ifdef HAVE_XLOCALE_H
   #include <xlocale.h>
 #endif
--
2.15.1


code:
From: Tobias Geerinckx-Rice <me@tobias.gr>
Date: Thu, 13 Aug 2020 15:21:30 +0200
Subject: [PATCH] gnu: opencv: Fix build with Jasper 2.0.19.

Taken verbatim from upstream: <https://github.com/opencv/opencv/issues/17984>.

From f66fc199a20882c546fa31142e9c0f5a8b3cf983 Mon Sep 17 00:00:00 2001
From: Florian Jung <flo@windfis.ch>
Date: Wed, 29 Jul 2020 18:51:55 +0200
Subject: [PATCH] Fix build of grfmt_jpeg2000.cpp

libjasper has recently changed `jas_matrix_get` from a macro to an inline function
(389951d071 in https://github.com/jasper-software/jasper), causing the build to fail.
---
 modules/imgcodecs/src/grfmt_jpeg2000.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/imgcodecs/src/grfmt_jpeg2000.cpp b/modules/imgcodecs/src/grfmt_jpeg2000.cpp
index fe69f80c86f..0f4d28d6f4d 100644
--- a/modules/imgcodecs/src/grfmt_jpeg2000.cpp
+++ b/modules/imgcodecs/src/grfmt_jpeg2000.cpp
@@ -377,7 +377,7 @@ bool  Jpeg2KDecoder::readComponent8u( uchar *data, void *_buffer,

     for( y = 0; y < yend - ystart; )
     {
-        jas_seqent_t* pix_row = &jas_matrix_get( buffer, y / ystep, 0 );
+        jas_seqent_t* pix_row = jas_matrix_getref( buffer, y / ystep, 0 );
         uchar* dst = data + (y - yoffset) * step - xoffset;

         if( xstep == 1 )
@@ -443,7 +443,7 @@ bool  Jpeg2KDecoder::readComponent16u( unsigned short *data, void *_buffer,

     for( y = 0; y < yend - ystart; )
     {
-        jas_seqent_t* pix_row = &jas_matrix_get( buffer, y / ystep, 0 );
+        jas_seqent_t* pix_row = jas_matrix_getref( buffer, y / ystep, 0 );
         ushort* dst = data + (y - yoffset) * step - xoffset;

         if( xstep == 1 )


code:
https://github.com/opencv/opencv_contrib/commit/8aaa91c3dc835690477d7777e66948dbf5a87edc.patch

From 8aaa91c3dc835690477d7777e66948dbf5a87edc Mon Sep 17 00:00:00 2001
From: Tomoaki Teshima <tomoaki.teshima@gmail.com>
Date: Mon, 5 Nov 2018 20:32:23 +0900
Subject: [PATCH] avoid test failing on Aarch64   * loosen the threshold in
 Rgbd_Normals.compute   * make the minimum tvec larger in
 RGBD_Odometry_Rgbd.algorithmic

---
 modules/rgbd/test/test_normal.cpp   | 2 +-
 modules/rgbd/test/test_odometry.cpp | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/rgbd/test/test_normal.cpp b/modules/rgbd/test/test_normal.cpp
index f2233553a7..ed54f2cd98 100644
--- a/modules/rgbd/test/test_normal.cpp
+++ b/modules/rgbd/test/test_normal.cpp
@@ -211,7 +211,7 @@ class CV_RgbdNormalsTest: public cvtest::BaseTest
             std::cout << std::endl << "*** FALS" << std::endl;
             errors[0][0] = 0.006f;
             errors[0][1] = 0.03f;
-            errors[1][0] = 0.00008f;
+            errors[1][0] = 0.0001f;
             errors[1][1] = 0.02f;
             break;
           case 1:
diff --git a/modules/rgbd/test/test_odometry.cpp b/modules/rgbd/test/test_odometry.cpp
index 62b654a1ec..f5a2084504 100644
--- a/modules/rgbd/test/test_odometry.cpp
+++ b/modules/rgbd/test/test_odometry.cpp
@@ -213,7 +213,7 @@ void CV_OdometryTest::generateRandomTransformation(Mat& rvec, Mat& tvec)
     normalize(rvec, rvec, rng.uniform(0.007f, maxRotation));

     randu(tvec, Scalar(-1000), Scalar(1000));
-    normalize(tvec, tvec, rng.uniform(0.007f, maxTranslation));
+    normalize(tvec, tvec, rng.uniform(0.008f, maxTranslation));
 }

 void CV_OdometryTest::run(int)


code:
# This patch removes all need for the ThirdParty files of OpenFOAM.

# Derived from EasyBuild patch by Ward Poelmans <wpoely86@gmail.com>.
# Modified for GNU Guix by Paul Garlick <pgarlick@tourbillion-technology.com>.

diff -ur OpenFOAM-4.x-version-4.1.org/applications/utilities/mesh/manipulation/setSet/Allwmake OpenFOAM-4.x-version-4.1/applications/utilities/mesh/manipulation/setSet/Allwmake
--- OpenFOAM-4.x-version-4.1.org/applications/utilities/mesh/manipulation/setSet/Allwmake
+++ OpenFOAM-4.x-version-4.1/applications/utilities/mesh/manipulation/setSet/Allwmake
@@ -9,7 +9,7 @@
 #
 # use readline if available
 #
-if [ -f /usr/include/readline/readline.h ]
+if true
 then
     echo "Found <readline/readline.h>  --  enabling readline support."
     export COMP_FLAGS="-DHAS_READLINE"
diff -ur OpenFOAM-4.x-version-4.1.org/etc/bashrc OpenFOAM-4.x-version-4.1/etc/bashrc
--- OpenFOAM-4.x-version-4.1.org/etc/bashrc
+++ OpenFOAM-4.x-version-4.1/etc/bashrc
@@ -43,8 +43,10 @@
 # Please set to the appropriate path if the default is not correct.
 #
 [ $BASH_SOURCE ] && \
-export FOAM_INST_DIR=$(cd ${BASH_SOURCE%/*/*/*} && pwd -P) || \
+export FOAM_INST_DIR=$(cd $(dirname $BASH_SOURCE)/../.. && pwd -P) || \
 export FOAM_INST_DIR=$HOME/$WM_PROJECT
+# For GNU Guix: set initially for build then re-set at runtime
+#
 # export FOAM_INST_DIR=~$WM_PROJECT
 # export FOAM_INST_DIR=/opt/$WM_PROJECT
 # export FOAM_INST_DIR=/usr/local/$WM_PROJECT
diff -ur OpenFOAM-4.x-version-4.1.org/etc/config.sh/CGAL OpenFOAM-4.x-version-4.1/etc/config.sh/CGAL
--- OpenFOAM-4.x-version-4.1.org/etc/config.sh/CGAL
+++ OpenFOAM-4.x-version-4.1/etc/config.sh/CGAL
@@ -36,37 +36,7 @@
 #
 #------------------------------------------------------------------------------

-boost_version=boost-system
-cgal_version=cgal-system
-#cgal_version=CGAL-4.8
-
-if [ -z "$SOURCE_CGAL_VERSIONS_ONLY" ]
-then
-
-    common_path=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER
-
-    export BOOST_ARCH_PATH=$common_path/$boost_version
-    export CGAL_ARCH_PATH=$common_path/$cgal_version
-
-    if [ "$FOAM_VERBOSE" -a "$PS1" ]
-    then
-        echo "Using CGAL and boost" 1>&2
-        echo "    $cgal_version at $CGAL_ARCH_PATH" 1>&2
-        echo "    $boost_version at $BOOST_ARCH_PATH" 1>&2
-    fi
-
-    if [ -d "$CGAL_ARCH_PATH" -a "$cgal_version" != "cgal-system" ]
-    then
-        _foamAddLib $CGAL_ARCH_PATH/lib
-    fi
-
-    if [ -d "$BOOST_ARCH_PATH" -a "$boost_version" != "boost-system" ]
-    then
-        _foamAddLib $BOOST_ARCH_PATH/lib
-    fi
-
-    unset boost_version cgal_version common_path
-
-fi
+export CGAL_ARCH_PATH=$CGAL_ROOT
+export BOOST_ARCH_PATH=$BOOST_ROOT

 #------------------------------------------------------------------------------
diff -ur OpenFOAM-4.x-version-4.1.org/etc/config.sh/gperftools OpenFOAM-4.x-version-4.1/etc/config.sh/gperftools
--- OpenFOAM-4.x-version-4.1.org/etc/config.sh/gperftools
+++ OpenFOAM-4.x-version-4.1/etc/config.sh/gperftools
@@ -29,13 +29,5 @@
 #
 #------------------------------------------------------------------------------

-version=svn
-gperftools_install=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER
-
-GPERFTOOLS_VERSION=gperftools-$version
-GPERFTOOLS_ARCH_PATH=$gperftools_install/$GPERFTOOLS_VERSION
-
-export PATH=$GPERFTOOLS_ARCH_PATH/bin:$PATH
-export LD_LIBRARY_PATH=$GPERFTOOLS_ARCH_PATH/lib:$LD_LIBRARY_PATH

 #------------------------------------------------------------------------------
diff -ur OpenFOAM-4.x-version-4.1.org/etc/config.sh/metis OpenFOAM-4.x-version-4.1/etc/config.sh/metis
--- OpenFOAM-4.x-version-4.1.org/etc/config.sh/metis
+++ OpenFOAM-4.x-version-4.1/etc/config.sh/metis
@@ -34,7 +34,7 @@
 #
 #------------------------------------------------------------------------------

-export METIS_VERSION=metis-5.1.0
-export METIS_ARCH_PATH=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER$WM_PRECISION_OPTION$WM_LABEL_OPTION/$METIS_VERSION
+export METIS_VERSION=metis-$METISVERSION
+export METIS_ARCH_PATH=$METIS_ROOT

 #------------------------------------------------------------------------------
diff -ur OpenFOAM-4.x-version-4.1.org/etc/config.sh/scotch OpenFOAM-4.x-version-4.1/etc/config.sh/scotch
--- OpenFOAM-4.x-version-4.1.org/etc/config.sh/scotch
+++ OpenFOAM-4.x-version-4.1/etc/config.sh/scotch
@@ -37,7 +37,7 @@
 #
 #------------------------------------------------------------------------------

-export SCOTCH_VERSION=scotch_6.0.3
-export SCOTCH_ARCH_PATH=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER$WM_PRECISION_OPTION$WM_LABEL_OPTION/$SCOTCH_VERSION
+export SCOTCH_VERSION=scotch_$SCOTCHVERSION
+export SCOTCH_ARCH_PATH=$SCOTCH_ROOT

 #------------------------------------------------------------------------------
diff -ur OpenFOAM-4.x-version-4.1.org/etc/config.sh/settings OpenFOAM-4.x-version-4.1/etc/config.sh/settings
--- OpenFOAM-4.x-version-4.1.org/etc/config.sh/settings
+++ OpenFOAM-4.x-version-4.1/etc/config.sh/settings
@@ -279,6 +279,9 @@
     ;;
 system)
     # Use system compiler
+    # Use system GMP and MPFR packages
+    export GMP_ARCH_PATH=$GMP_ROOT
+    export MPFR_ARCH_PATH=$MPFR_ROOT
     ;;
 *)
     echo "Warn: WM_COMPILER_TYPE='$WM_COMPILER_TYPE' is unsupported" 1>&2
diff -ur OpenFOAM-4.x-version-4.1.org/src/parallel/decompose/ptscotchDecomp/Make/options OpenFOAM-4.x-version-4.1/src/parallel/decompose/ptscotchDecomp/Make/options
--- OpenFOAM-4.x-version-4.1.org/src/parallel/decompose/ptscotchDecomp/Make/options
+++ OpenFOAM-4.x-version-4.1/src/parallel/decompose/ptscotchDecomp/Make/options
@@ -5,8 +5,7 @@
     $(PFLAGS) $(PINC) \
     -I$(SCOTCH_ROOT)/include \
     -I$(SCOTCH_ARCH_PATH)/include/$(FOAM_MPI) \
-    -I/usr/include/scotch \
     -I../decompositionMethods/lnInclude

 LIB_LIBS = \
-    -L$(SCOTCH_ROOT)/lib -L$(FOAM_EXT_LIBBIN)/$(FOAM_MPI) -lptscotch -lptscotcherrexit -lscotch ${LINK_FLAGS} -lrt
+    -L$(SCOTCH_ROOT)/lib -L$(MPI_ARCH_PATH)/lib -lptscotch -lptscotcherrexit -lscotch ${LINK_FLAGS} -lrt
diff -ur OpenFOAM-4.x-version-4.1.org/src/parallel/decompose/scotchDecomp/Make/options OpenFOAM-4.x-version-4.1/src/parallel/decompose/scotchDecomp/Make/options
--- OpenFOAM-4.x-version-4.1.org/src/parallel/decompose/scotchDecomp/Make/options
+++ OpenFOAM-4.x-version-4.1/src/parallel/decompose/scotchDecomp/Make/options
@@ -9,8 +9,7 @@
     $(PFLAGS) $(PINC) \
     -I$(SCOTCH_ROOT)/include \
     -I$(SCOTCH_ARCH_PATH)/include \
-    -I/usr/include/scotch \
     -I../decompositionMethods/lnInclude

 LIB_LIBS = \
-    -L$(SCOTCH_ROOT)/lib -L$(FOAM_EXT_LIBBIN) -lscotch -lscotcherrexit -lrt
+    -L$(SCOTCH_ROOT)/lib -lscotch -lscotcherrexit -lrt
diff -ur OpenFOAM-4.x-version-4.1.org/wmake/makefiles/general OpenFOAM-4.x-version-4.1/wmake/makefiles/general
--- OpenFOAM-4.x-version-4.1.org/wmake/makefiles/general
+++ OpenFOAM-4.x-version-4.1/wmake/makefiles/general
@@ -33,7 +33,6 @@
 # The Makefile uses a POSIX shell
 #------------------------------------------------------------------------------

-SHELL           = /bin/sh

 #------------------------------------------------------------------------------
diff -ur OpenFOAM-4.x-version-4.1.org/wmake/wmake OpenFOAM-4.x-version-4.1/wmake/wmake
--- OpenFOAM-4.x-version-4.1.org/wmake/wmake
+++ OpenFOAM-4.x-version-4.1/wmake/wmake
@@ -163,7 +163,7 @@
 then
     if [ "$WM_NCOMPPROCS" -gt 1 -a ! "$MAKEFLAGS" ]
     then
-        lockDir=$HOME/.$WM_PROJECT/.wmake
+        lockDir=$(cd $(dirname $BASH_SOURCE)/../.. && pwd -P)/.$WM_PROJECT/.wmake

         if [ -d $lockDir ]
         then
diff -ur OpenFOAM-4.x-version-4.1.org/wmake/wmakeScheduler OpenFOAM-4.x-version-4.1/wmake/wmakeScheduler
--- OpenFOAM-4.x-version-4.1.org/wmake/wmakeScheduler
+++ OpenFOAM-4.x-version-4.1/wmake/wmakeScheduler
@@ -53,7 +53,7 @@
 # csh sets HOST, bash sets HOSTNAME
 : ${HOST:=$HOSTNAME}

-lockDir=$HOME/.$WM_PROJECT/.wmake
+lockDir=$(cd $(dirname $BASH_SOURCE)/../.. && pwd -P)/.$WM_PROJECT/.wmake

 # Fallback - 1 core on current host
 : ${WM_HOSTS:=$HOST:1}
diff -ur OpenFOAM-4.x-version-4.1.org/wmake/wmakeSchedulerUptime OpenFOAM-4.x-version-4.1/wmake/wmakeSchedulerUptime
--- OpenFOAM-4.x-version-4.1.org/wmake/wmakeSchedulerUptime
+++ OpenFOAM-4.x-version-4.1/wmake/wmakeSchedulerUptime
@@ -53,7 +53,7 @@
 # csh sets HOST, bash sets HOSTNAME
 : ${HOST:=$HOSTNAME}

-lockDir=$HOME/.$WM_PROJECT/.wmake
+lockDir=$(cd $(dirname $BASH_SOURCE)/../.. && pwd -P)/.$WM_PROJECT/.wmake
 # Fallback - 1 core on current host
 : ${WM_HOSTS:=$HOST:1}

diff -ur OpenFOAM-4.x-version-4.1.org/src/parallel/decompose/metisDecomp/metisDecomp.C OpenFOAM-4.x-version-4.1/src/parallel/decompose/metisDecomp/metisDecomp.C
--- OpenFOAM-4.x-version-4.1.org/src/parallel/decompose/metisDecomp/metisDecomp.C
+++ OpenFOAM-4.x-version-4.1/src/parallel/decompose/metisDecomp/metisDecomp.C
@@ -67,7 +67,7 @@

     // Processor weights initialised with no size, only used if specified in
     // a file
-    Field<scalar> processorWeights;
+    Field<floatScalar> processorWeights;

     // Cell weights (so on the vertices of the dual)
     List<label> cellWeights;
diff -ur OpenFOAM-4.x-version-4.1.org/wmake/rules/General/CGAL OpenFOAM-4.x-version-4.1/wmake/rules/General/CGAL
--- OpenFOAM-4.x-version-4.1.org/wmake/rules/General/CGAL
+++ OpenFOAM-4.x-version-4.1/wmake/rules/General/CGAL
@@ -6,9 +6,10 @@
     -I/usr/include

 CGAL_LIBS = \
-    -L$(MPFR_ARCH_PATH)/lib$(WM_COMPILER_LIB_ARCH) \
-    -L$(GMP_ARCH_PATH)/lib$(WM_COMPILER_LIB_ARCH) \
+    -L$(MPFR_ARCH_PATH)/lib \
+    -L$(GMP_ARCH_PATH)/lib \
     -L$(BOOST_ARCH_PATH)/lib \
     -L$(CGAL_ARCH_PATH)/lib \
     -lCGAL \
+    -lgmp \
     -lmpfr
diff -ur OpenFOAM-4.x-version-4.1.org/wmake/rules/linux64Gcc/c++ OpenFOAM-4.x-version-4.1/wmake/rules/linux64Gcc/c++
--- OpenFOAM-4.x-version-4.1.org/wmake/rules/linux64Gcc/c++
+++ OpenFOAM-4.x-version-4.1/wmake/rules/linux64Gcc/c++
@@ -20,5 +20,5 @@

 LINK_LIBS   = $(c++DBUG)

-LINKLIBSO   = $(CC) $(c++FLAGS) -shared -Xlinker --add-needed -Xlinker --no-as-needed
-LINKEXE     = $(CC) $(c++FLAGS) -Xlinker --add-needed -Xlinker --no-as-needed
+LINKLIBSO   = $(CC) $(c++FLAGS) $(LDFLAGS) -shared -Xlinker --add-needed -Xlinker --no-as-needed
+LINKEXE     = $(CC) $(c++FLAGS) $(LDFLAGS) -Xlinker --add-needed -Xlinker --no-as-needed


code:
From a0a0c6a43b88d946f2b5484892cf0209bd7c0e68 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?G=C3=A1bor=20Boskovits?= <boskovits@gmail.com>
Date: Sat, 8 Dec 2018 21:25:31 +0100
Subject: [PATCH] Make idlj respect SOURCE_DATE_EPOCH.

---
 .../sun/tools/corba/se/idl/toJavaPortable/Util.java | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/Util.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/Util.java
index 7397619f2..583d6b8e4 100644
--- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/Util.java
+++ b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/Util.java
@@ -1146,7 +1146,18 @@ public class Util extends com.sun.tools.corba.se.idl.Util
     else
       formatter.setTimeZone (java.util.TimeZone.getDefault ());

-    stream.println ("* " + formatter.format (new Date ()));
+    try {
+	String epoch = System.getenv("SOURCE_DATE_EPOCH");
+	if(epoch != null) {
+	    long unixTime = Long.parseLong(epoch);
+	    stream.println ("* " + formatter.format (new Date (unixTime*1000L)));
+	} else {
+	    stream.println ("* " + formatter.format (new Date ()));
+	}
+    } catch (Exception e) {
+	//in case of error fall back to default
+	stream.println ("* " + formatter.format (new Date ()));
+    }

     // <daz>
     ///////////////
--
2.19.2


code:
--- jdk14-bc54620a3848/make/autoconf/basics.m4	2020-02-07 04:40:54.000000000 +1030
+++ jdk14-bc54620a3848-new/make/autoconf/basics.m4	2020-04-24 10:59:33.056098506 +0930
@@ -583,7 +583,7 @@
   BASIC_SETUP_TOOL($1, [AC_PATH_PROGS($1, $2, , $3)])
   if test "x[$]$1" = x; then
     AC_MSG_NOTICE([Required tool $2 not found in PATH, checking built-in])
-    if help $2 > /dev/null 2>&1; then
+    if command -v $2 > /dev/null 2>&1; then
       AC_MSG_NOTICE([Found $2 as shell built-in. Using it])
       $1="$2"
     else


code:
PSM2 is the only valid implementation for OmniPath (OPA).  UCX also
supports OmniPath, but it does so via Verbs, thus getting much lower
performance (typically 3 GiB/s instead of 10 GiB/s).

To work around that, give the mtl_psm2 component a higher priority
than the pml_ucx component.

See <https://www.mail-archive.com/users@lists.open-mpi.org/msg33581.html>.

--- openmpi-4.0.2/ompi/mca/mtl/psm2/mtl_psm2_component.c	2019-11-15 17:06:15.142076840 +0100
+++ openmpi-4.0.2/ompi/mca/mtl/psm2/mtl_psm2_component.c	2019-11-15 17:06:22.242009379 +0100
@@ -126,7 +126,7 @@ ompi_mtl_psm2_component_register(void)
         setenv("PSM2_DEVICES", "self,shm", 0);
     }

-    param_priority = 40;
+    param_priority = 55;
     (void) mca_base_component_var_register (&mca_mtl_psm2_component.super.mtl_version,
                                             "priority", "Priority of the PSM2 MTL component",
                                             MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,

Likewise for PSM: we want InfiniPath to be taken care of by PSM, not by UCX,
since UCX achieves worse performance.

--- openmpi-4.0.2/ompi/mca/mtl/psm/mtl_psm_component.c
+++ openmpi-4.0.2/ompi/mca/mtl/psm/mtl_psm_component.c
@@ -92,7 +92,7 @@ ompi_mtl_psm_component_register(void)

     /* set priority high enough to beat ob1's default */
-    param_priority = 30;
+    param_priority = 54;
     (void) mca_base_component_var_register (&mca_mtl_psm_component.super.mtl_version,
                                             "priority", "Priority of the PSM MTL component",
                                             MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,


code:
From 7f0ce36828ec1e130bee857b8236ca091e4d8a2c Mon Sep 17 00:00:00 2001
From: Brice Waegeneire <brice@waegenei.re>
Date: Sat, 9 May 2020 15:52:06 +0200
Subject: [PATCH] Add RESTARTCMD for Guix System.

---

openresolv need to know how to restart the nscd service, this patch teach it
to do it on Guix System by using shepherd.

 resolvconf.in | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/resolvconf.in b/resolvconf.in
index 3cad04d..5ef5294 100644
--- a/resolvconf.in
+++ b/resolvconf.in
@@ -369,6 +369,13 @@ detect_init()
 			then
 				/etc/rc.d/$1 restart
 			fi'
+	elif [ -e /gnu/store ] && [ -e /run/current-system/profile ]; then
+		# Guix System
+		RESTARTCMD='
+			if /run/current-system/profile/bin/herd status $1 2>&1
+			then
+				/run/current-system/profile/bin/herd restart $1
+			fi'
 	else
 		for x in /etc/init.d/rc.d /etc/rc.d /etc/init.d; do
 			[ -d $x ] || continue
--
2.26.0


code:
From 3a78134a35b448d9d4136ffbc55175be7fab6644 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <raghavgururajan@disroot.org>
Date: Mon, 6 Jul 2020 00:34:20 -0400
Subject: [PATCH] [PATCH]: Add license file.

---
 LICENSE.txt | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)
 create mode 100644 LICENSE.txt

diff --git a/LICENSE.txt b/LICENSE.txt
new file mode 100644
index 0000000..0fce823
--- /dev/null
+++ b/LICENSE.txt
@@ -0,0 +1,25 @@
+/*
+ * Copyright (c) 2007-2011 The Khronos Group Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
+ * this software and /or associated documentation files (the "Materials "), to
+ * deal in the Materials without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Materials, and to permit persons to whom the Materials are
+ * furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Materials.
+ *
+ * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS IN THE
+ * MATERIALS.
+ *
+ * OpenSLES_IID.c - OpenSL ES version 1.1
+ *
+ */
\ No newline at end of file
--
2.26.2


code:
Author: Jan (janneke) Nieuwenhuizen" <janneke@gnu.org>
Not upstreamed.

From 1ddae040d67e9a4ebcc3e1b95af1bff12c0f086b Mon Sep 17 00:00:00 2001
From: "Jan (janneke) Nieuwenhuizen" <janneke@gnu.org>
Date: Tue, 7 Apr 2020 17:41:05 +0200
Subject: [PATCH] Build fix for the Hurd.

* gss-serv.c (ssh_gssapi_acquire_cred): Use HOST_NAME_MAX instead of
MAXHOSTNAMELEN.
---
 gss-serv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gss-serv.c b/gss-serv.c
index 1d47870e7..22081c6f1 100644
--- a/gss-serv.c
+++ b/gss-serv.c
@@ -107,7 +107,7 @@ ssh_gssapi_acquire_cred(Gssctxt *ctx)
 		gss_create_empty_oid_set(&status, &oidset);
 		gss_add_oid_set_member(&status, ctx->oid, &oidset);

-		if (gethostname(lname, MAXHOSTNAMELEN)) {
+		if (gethostname(lname, HOST_NAME_MAX)) {
 			gss_release_oid_set(&status, &oidset);
 			return (-1);
 		}
--
2.26.0


code:
This patch removes the explicit reference to the 'perl' binary,
such that OpenSSL does not retain a reference to Perl.

The 'c_rehash' program is seldom used, but it is used nonetheless
to create symbolic links to certificates, for instance in the 'nss-certs'
package.

diff --git a/tools/c_rehash.in b/tools/c_rehash.in
index 421fd89208..93aca4e168 100644
--- a/tools/c_rehash.in
+++ b/tools/c_rehash.in
@@ -1,4 +1,6 @@
-#!{- $config{HASHBANGPERL} -}
+eval '(exit $?0)' && eval 'exec perl -wS "$0" ${1+"$@"}'
+  & eval 'exec perl -wS "$0" $argv:q'
+    if 0;

 # {- join("\n# ", @autowarntext) -}
 # Copyright 1999-2018 The OpenSSL Project Authors. All Rights Reserved.


code:
From e9bbefbf0f24c57645e7ad6a5a71ae649d18ac8e Mon Sep 17 00:00:00 2001
From: Matt Caswell <matt@openssl.org>
Date: Fri, 14 Dec 2018 07:28:30 +0000
Subject: [PATCH] Go into the error state if a fatal alert is sent or received

If an application calls SSL_shutdown after a fatal alert has occured and
then behaves different based on error codes from that function then the
application may be vulnerable to a padding oracle.

CVE-2019-1559

Reviewed-by: Richard Levitte <levitte@openssl.org>
---
 ssl/d1_pkt.c |  1 +
 ssl/s3_pkt.c | 10 +++++++---
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/ssl/d1_pkt.c b/ssl/d1_pkt.c
index 23aa9db..c7fe977 100644
--- a/ssl/d1_pkt.c
+++ b/ssl/d1_pkt.c
@@ -1309,6 +1309,7 @@ int dtls1_read_bytes(SSL *s, int type, unsigned char *buf, int len, int peek)
             ERR_add_error_data(2, "SSL alert number ", tmp);
             s->shutdown |= SSL_RECEIVED_SHUTDOWN;
             SSL_CTX_remove_session(s->session_ctx, s->session);
+            s->state = SSL_ST_ERR;
             return (0);
         } else {
             al = SSL_AD_ILLEGAL_PARAMETER;
diff --git a/ssl/s3_pkt.c b/ssl/s3_pkt.c
index 6527df8..830b723 100644
--- a/ssl/s3_pkt.c
+++ b/ssl/s3_pkt.c
@@ -1500,6 +1500,7 @@ int ssl3_read_bytes(SSL *s, int type, unsigned char *buf, int len, int peek)
             ERR_add_error_data(2, "SSL alert number ", tmp);
             s->shutdown |= SSL_RECEIVED_SHUTDOWN;
             SSL_CTX_remove_session(s->session_ctx, s->session);
+            s->state = SSL_ST_ERR;
             return (0);
         } else {
             al = SSL_AD_ILLEGAL_PARAMETER;
@@ -1719,9 +1720,12 @@ int ssl3_send_alert(SSL *s, int level, int desc)
                                           * protocol_version alerts */
     if (desc < 0)
         return -1;
-    /* If a fatal one, remove from cache */
-    if ((level == 2) && (s->session != NULL))
-        SSL_CTX_remove_session(s->session_ctx, s->session);
+    /* If a fatal one, remove from cache and go into the error state */
+    if (level == SSL3_AL_FATAL) {
+        if (s->session != NULL)
+            SSL_CTX_remove_session(s->session_ctx, s->session);
+        s->state = SSL_ST_ERR;
+    }

     s->s3->alert_dispatch = 1;
     s->s3->send_alert[0] = level;
--
2.7.4


code:
This patch removes the explicit reference to the 'perl' binary,
such that OpenSSL does not retain a reference to Perl.

The 'c_rehash' program is seldom used, but it is used nonetheless
to create symbolic links to certificates, for instance in the 'nss-certs'
package.

--- openssl-1.0.2g/tools/c_rehash.in	2015-09-09 18:36:07.313316482 +0200
+++ openssl-1.0.2g/tools/c_rehash.in	2015-09-09 18:36:28.965458458 +0200
@@ -1,4 +1,6 @@
-#!/usr/local/bin/perl
+eval '(exit $?0)' && eval 'exec perl -wS "$0" ${1+"$@"}'
+  & eval 'exec perl -wS "$0" $argv:q'
+    if 0;

 # Perl c_rehash script, scan all files in a directory
 # and add symbolic links to their hash values.


code:
This patch makes the build system pass -Wl,-rpath=$out/lib even for
libraries (it already does so for executables, thanks to 'DO_GNU_APP'
in 'Makefile.shared'.)

--- openssl-1.0.2a/Makefile.shared	2015-04-05 01:07:35.357602454 +0200
+++ openssl-1.0.2a/Makefile.shared	2015-04-05 01:09:50.474513303 +0200
@@ -106,7 +106,7 @@ LINK_SO=	\
     LIBPATH=`for x in $$LIBDEPS; do echo $$x; done | sed -e 's/^ *-L//;t' -e d | uniq`; \
     LIBPATH=`echo $$LIBPATH | sed -e 's/ /:/g'`; \
     LD_LIBRARY_PATH=$$LIBPATH:$$LD_LIBRARY_PATH \
-    $${SHAREDCMD} $${SHAREDFLAGS} \
+    $${SHAREDCMD} $${SHAREDFLAGS} -Wl,-rpath,$(LIBRPATH) \
 	-o $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX \
 	$$ALLSYMSFLAGS $$SHOBJECTS $$NOALLSYMSFLAGS $$LIBDEPS \
   ) && $(SYMLINK_SO)


code:
The 'intcompare' definition was causing a "cast from 'void*' to 'int' loses
precision [-fpermissive]" error.  It isn't used anywhere, so simply remove it.
Same with 'findint' in texteditor.cc.

Fix other "cast from ‘void*’ to ‘int’ loses precision" errors.

--- a/kkstrtext-0.1/kkstrtext.cc	2005-01-31 18:13:24.000000000 -0600
+++ b/kkstrtext-0.1/kkstrtext.cc	2014-07-24 00:25:07.149305476 -0500
@@ -430,10 +430,6 @@
     }
 }

-int intcompare(void *s1, void *s2) {
-    return (int) s1 != (int) s2;
-}
-
 string i2str(int i) {
     char buf[64];
     sprintf(buf, "%d", i);
@@ -885,7 +881,7 @@
 #ifdef HAVE_ICONV
     iconv_t cd = iconv_open(tocs.c_str(), fromcs.c_str());

-    if(((int) cd) != -1) {
+    if(cd != (iconv_t) -1) {
 	string r, text(atext);
 	size_t inleft, outleft, soutleft;
 	char *inbuf, *outbuf, *sinbuf, *soutbuf;
--- a/kkconsui-0.1/src/texteditor.cc	2003-09-09 16:51:33.000000000 -0500
+++ b/kkconsui-0.1/src/texteditor.cc	2014-07-24 00:33:20.093279060 -0500
@@ -1939,10 +1939,6 @@
     if(ur) delete ur;
 }

-int texteditor::findint(void *p1, void *p2) {
-    return *(int *) p1 != (int) p2;
-}
-
 int texteditor::findhighline(void *p1, void *p2) {
     return *(int *) p1 != ((highline *) p2)->line;
 }
--- a/src/streamtrack.cc	2006-05-11 12:45:20.000000000 -0500
+++ b/src/streamtrack.cc	2014-07-24 00:38:10.797263482 -0500
@@ -34,6 +34,7 @@
 #include <sys/wait.h>
 #include <sys/stat.h>
 #include <signal.h>
+#include <unistd.h>

 #include <algorithm>


code:
Fix CVE-2017-7853:

https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-7853
https://savannah.gnu.org/support/index.php?109265

Patch copied from upstream source repository:

https://git.savannah.gnu.org/cgit/osip.git/commit/?id=1ae06daf3b2375c34af23083394a6f010be24a45

From 1ae06daf3b2375c34af23083394a6f010be24a45 Mon Sep 17 00:00:00 2001
From: Aymeric Moizard <amoizard@gmail.com>
Date: Tue, 21 Feb 2017 17:16:26 +0100
Subject: [PATCH]  * fix bug report: sr #109265: SIP message body length
 underflow in libosip2-4.1.0    https://savannah.gnu.org/support/?109265
 also applicable to current latest version

---
 src/osipparser2/osip_message_parse.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/osipparser2/osip_message_parse.c b/src/osipparser2/osip_message_parse.c
index 1628c60..aa35446 100644
--- a/src/osipparser2/osip_message_parse.c
+++ b/src/osipparser2/osip_message_parse.c
@@ -784,6 +784,12 @@ msg_osip_body_parse (osip_message_t * sip, const char *start_of_buf, const char
     if ('\n' == start_of_body[0] || '\r' == start_of_body[0])
       start_of_body++;

+    /* if message body is empty or contains a single CR/LF */
+    if (end_of_body <= start_of_body) {
+      osip_free (sep_boundary);
+      return OSIP_SYNTAXERROR;
+    }
+
     body_len = end_of_body - start_of_body;

     /* Skip CR before end boundary. */
--
2.13.1


code:
The file $(top_srcdir)/gtk-doc.make doesn't exist, so don't include it.

--- a/doc/Makefile.in	2007-04-08 20:17:25.000000000 +0200
+++ b/doc/Makefile.in	2014-09-06 23:19:41.413397662 +0200
@@ -240,9 +240,6 @@
 distclean-generic clean-generic maintainer-clean-generic clean \
 mostlyclean distclean maintainer-clean

-
-include $(top_srcdir)/gtk-doc.make
-
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
 .NOEXPORT:


code:
This patch is taken from Debian and modified slightly

Description: Phoning-home version checks should be disabled in Debian packages
Author: Sandro Knauß <bugs@ssandroknauss.de>
Origin: debian
Bug-debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=721341
Forwarded: not-needed
Last-Update: 2014-02-17
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/src/libsync/configfile.cpp
+++ b/src/libsync/configfile.cpp
@@ -522,11 +522,14 @@ bool ConfigFile::skipUpdateCheck(const Q
     if (connection.isEmpty())
         con = defaultConnection();

-    QVariant fallback = getValue(skipUpdateCheckC(), con, false);
+    QVariant fallback = getValue(skipUpdateCheckC(), con, true);
     fallback = getValue(skipUpdateCheckC(), QString(), fallback);

     QVariant value = getPolicySetting(skipUpdateCheckC(), fallback);
-    return value.toBool();
+    if ( !value.toBool() )
+        qDebug() << "Guix has disabled the UpdateCheck mechanism.";
+
+    return true;
 }

 void ConfigFile::setSkipUpdateCheck(bool skip, const QString &connection)
--- a/src/gui/generalsettings.cpp
+++ b/src/gui/generalsettings.cpp
@@ -146,6 +149,7 @@ void GeneralSettings::loadMiscSettings()

 void GeneralSettings::slotUpdateInfo()
 {
+    /* Guix doesn't want an autoupdater
     if (ConfigFile().skipUpdateCheck() || !Updater::instance()) {
         // updater disabled on compile
         _ui->updaterWidget->setVisible(false);
@@ -174,6 +178,9 @@ void GeneralSettings::slotUpdateInfo()
     _ui->updateChannel->setCurrentIndex(ConfigFile().updateChannel() == "beta" ? 1 : 0);
     connect(_ui->updateChannel, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
         this, &GeneralSettings::slotUpdateChannelChanged, Qt::UniqueConnection);
+    */
+    //hide the update group box for Guix.
+    _ui->updaterWidget->setVisible(false);
 }

 void GeneralSettings::slotUpdateChannelChanged(int index)


code:
From: Robert Luberda <robert@debian.org>
Date: Sat, 19 Nov 2016 08:48:08 +0100
Subject: Fix nullptr dereference (CVE-2016-9296)

Patch taken from https://sourceforge.net/p/p7zip/bugs/185/
This patch file taken from Debian's patch set for p7zip
---
 CPP/7zip/Archive/7z/7zIn.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/CPP/7zip/Archive/7z/7zIn.cpp b/CPP/7zip/Archive/7z/7zIn.cpp
index b0c6b98..7c6dde2 100644
--- a/CPP/7zip/Archive/7z/7zIn.cpp
+++ b/CPP/7zip/Archive/7z/7zIn.cpp
@@ -1097,7 +1097,8 @@ HRESULT CInArchive::ReadAndDecodePackedStreams(
       if (CrcCalc(data, unpackSize) != folders.FolderCRCs.Vals[i])
         ThrowIncorrect();
   }
-  HeadersSize += folders.PackPositions[folders.NumPackStreams];
+  if (folders.PackPositions)
+      HeadersSize += folders.PackPositions[folders.NumPackStreams];
   return S_OK;
 }


code:
Fix CVE-2017-17969:

https://sourceforge.net/p/p7zip/bugs/204/
https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-17969

Patch copied from Debian.

Subject: Heap-based buffer overflow in 7zip/Compress/ShrinkDecoder.cpp
Origin: vendor, https://sourceforge.net/p/p7zip/bugs/_discuss/thread/0920f369/27d7/attachment/CVE-2017-17969.patch
Forwarded: https://sourceforge.net/p/p7zip/bugs/_discuss/thread/0920f369/#27d7
Bug: https://sourceforge.net/p/p7zip/bugs/204/
Bug-Debian: https://bugs.debian.org/888297
Bug-Debian-Security: https://security-tracker.debian.org/tracker/CVE-2017-17969
Author: Antoine Beaupré <anarcat@debian.org>
Reviewed-by: Salvatore Bonaccorso <carnil@debian.org>
Last-Update: 2018-02-01
Applied-Upstream: 18.00-beta

--- a/CPP/7zip/Compress/ShrinkDecoder.cpp
+++ b/CPP/7zip/Compress/ShrinkDecoder.cpp
@@ -121,8 +121,13 @@ HRESULT CDecoder::CodeReal(ISequentialIn
     {
       _stack[i++] = _suffixes[cur];
       cur = _parents[cur];
+      if (cur >= kNumItems || i >= kNumItems)
+        break;
     }
-
+
+    if (cur >= kNumItems || i >= kNumItems)
+      break;
+
     _stack[i++] = (Byte)cur;
     lastChar2 = (Byte)cur;


code:
diff --git a/C/Sha1.c b/C/Sha1.c
index 55c1c63..48b4c5d 100644
--- a/C/Sha1.c
+++ b/C/Sha1.c
@@ -104,39 +104,6 @@ void Sha1_GetBlockDigest(CSha1 *p, const UInt32 *data, UInt32 *destDigest)
   destDigest[4] = p->state[4] + e;
 }

-void Sha1_UpdateBlock_Rar(CSha1 *p, UInt32 *data, int returnRes)
-{
-  UInt32 a, b, c, d, e;
-  UInt32 W[kNumW];
-
-  a = p->state[0];
-  b = p->state[1];
-  c = p->state[2];
-  d = p->state[3];
-  e = p->state[4];
-
-  RX_15
-
-  RX_1_4(R0, R1, 15);
-
-  RX_20(R2, 20);
-  RX_20(R3, 40);
-  RX_20(R4, 60);
-
-  p->state[0] += a;
-  p->state[1] += b;
-  p->state[2] += c;
-  p->state[3] += d;
-  p->state[4] += e;
-
-  if (returnRes)
-  {
-    unsigned i;
-    for (i = 0 ; i < SHA1_NUM_BLOCK_WORDS; i++)
-      data[i] = W[kNumW - SHA1_NUM_BLOCK_WORDS + i];
-  }
-}
-
 #define Sha1_UpdateBlock(p) Sha1_GetBlockDigest(p, p->buffer, p->state)

 void Sha1_Update(CSha1 *p, const Byte *data, size_t size)
@@ -212,46 +179,6 @@ void Sha1_Update(CSha1 *p, const Byte *data, size_t size)
   }
 }

-void Sha1_Update_Rar(CSha1 *p, Byte *data, size_t size /* , int rar350Mode */)
-{
-  int returnRes = False;
-
-  unsigned pos = (unsigned)p->count & 0x3F;
-  p->count += size;
-
-  while (size--)
-  {
-    unsigned pos2 = (pos & 3);
-    UInt32 v = ((UInt32)*data++) << (8 * (3 - pos2));
-    UInt32 *ref = &(p->buffer[pos >> 2]);
-    pos++;
-    if (pos2 == 0)
-    {
-      *ref = v;
-      continue;
-    }
-    *ref |= v;
-
-    if (pos == SHA1_BLOCK_SIZE)
-    {
-      pos = 0;
-      Sha1_UpdateBlock_Rar(p, p->buffer, returnRes);
-      if (returnRes)
-      {
-        unsigned i;
-        for (i = 0; i < SHA1_NUM_BLOCK_WORDS; i++)
-        {
-          UInt32 d = p->buffer[i];
-          Byte *prev = data + i * 4 - SHA1_BLOCK_SIZE;
-          SetUi32(prev, d);
-        }
-      }
-      // returnRes = rar350Mode;
-      returnRes = True;
-    }
-  }
-}
-
 void Sha1_Final(CSha1 *p, Byte *digest)
 {
   unsigned pos = (unsigned)p->count & 0x3F;
diff --git a/C/Sha1.h b/C/Sha1.h
index aa22ec3..9c45653 100644
--- a/C/Sha1.h
+++ b/C/Sha1.h
@@ -27,8 +27,6 @@ void Sha1_GetBlockDigest(CSha1 *p, const UInt32 *data, UInt32 *destDigest);
 void Sha1_Update(CSha1 *p, const Byte *data, size_t size);
 void Sha1_Final(CSha1 *p, Byte *digest);

-void Sha1_Update_Rar(CSha1 *p, Byte *data, size_t size /* , int rar350Mode */);
-
 void Sha1_32_PrepareBlock(const CSha1 *p, UInt32 *block, unsigned size);
 void Sha1_32_Update(CSha1 *p, const UInt32 *data, size_t size);
 void Sha1_32_Final(CSha1 *p, UInt32 *digest);
diff --git a/CPP/7zip/Archive/7z/7zUpdate.cpp b/CPP/7zip/Archive/7z/7zUpdate.cpp
index a0571e7..43ad3e9 100644
--- a/CPP/7zip/Archive/7z/7zUpdate.cpp
+++ b/CPP/7zip/Archive/7z/7zUpdate.cpp
@@ -562,7 +562,7 @@ static int CompareEmptyItems(const unsigned *p1, const unsigned *p2, void *param
 }

 static const char *g_Exts =
-  " 7z xz lzma ace arc arj bz tbz bz2 tbz2 cab deb gz tgz ha lha lzh lzo lzx pak rar rpm sit zoo"
+  " 7z xz lzma ace arc arj bz tbz bz2 tbz2 cab deb gz tgz ha lha lzh lzo lzx pak rpm sit zoo"
   " zip jar ear war msi"
   " 3gp avi mov mpeg mpg mpe wmv"
   " aac ape fla flac la mp3 m4a mp4 ofr ogg pac ra rm rka shn swa tta wv wma wav"
diff --git a/CPP/7zip/Bundles/Format7zFree/makefile.list b/CPP/7zip/Bundles/Format7zFree/makefile.list
index da2056b..1dcf1a5 100644
--- a/CPP/7zip/Bundles/Format7zFree/makefile.list
+++ b/CPP/7zip/Bundles/Format7zFree/makefile.list
@@ -87,8 +87,6 @@ SRCS=\
   ../../../../CPP/7zip/Archive/PeHandler.cpp \
   ../../../../CPP/7zip/Archive/PpmdHandler.cpp \
   ../../../../CPP/7zip/Archive/QcowHandler.cpp \
-  ../../../../CPP/7zip/Archive/Rar/RarHandler.cpp \
-  ../../../../CPP/7zip/Archive/Rar/Rar5Handler.cpp \
   ../../../../CPP/7zip/Archive/RpmHandler.cpp \
   ../../../../CPP/7zip/Archive/SplitHandler.cpp \
   ../../../../CPP/7zip/Archive/SquashfsHandler.cpp \
@@ -191,9 +189,6 @@ SRCS=\
   ../../../../CPP/7zip/Crypto/MyAesReg.cpp \
   ../../../../CPP/7zip/Crypto/Pbkdf2HmacSha1.cpp \
   ../../../../CPP/7zip/Crypto/RandGen.cpp \
-  ../../../../CPP/7zip/Crypto/Rar20Crypto.cpp \
-  ../../../../CPP/7zip/Crypto/Rar5Aes.cpp \
-  ../../../../CPP/7zip/Crypto/RarAes.cpp \
   ../../../../CPP/7zip/Crypto/WzAes.cpp \
   ../../../../CPP/7zip/Crypto/ZipCrypto.cpp \
   ../../../../CPP/7zip/Crypto/ZipStrong.cpp \
@@ -485,10 +480,6 @@ PpmdHandler.o : ../../../../CPP/7zip/Archive/PpmdHandler.cpp
 	$(CXX) $(CXXFLAGS) ../../../../CPP/7zip/Archive/PpmdHandler.cpp
 QcowHandler.o : ../../../../CPP/7zip/Archive/QcowHandler.cpp
 	$(CXX) $(CXXFLAGS) ../../../../CPP/7zip/Archive/QcowHandler.cpp
-RarHandler.o : ../../../../CPP/7zip/Archive/Rar/RarHandler.cpp
-	$(CXX) $(CXXFLAGS) ../../../../CPP/7zip/Archive/Rar/RarHandler.cpp
-Rar5Handler.o : ../../../../CPP/7zip/Archive/Rar/Rar5Handler.cpp
-	$(CXX) $(CXXFLAGS) ../../../../CPP/7zip/Archive/Rar/Rar5Handler.cpp
 RpmHandler.o : ../../../../CPP/7zip/Archive/RpmHandler.cpp
 	$(CXX) $(CXXFLAGS) ../../../../CPP/7zip/Archive/RpmHandler.cpp
 SplitHandler.o : ../../../../CPP/7zip/Archive/SplitHandler.cpp
@@ -693,12 +684,6 @@ Pbkdf2HmacSha1.o : ../../../../CPP/7zip/Crypto/Pbkdf2HmacSha1.cpp
 	$(CXX) $(CXXFLAGS) ../../../../CPP/7zip/Crypto/Pbkdf2HmacSha1.cpp
 RandGen.o : ../../../../CPP/7zip/Crypto/RandGen.cpp
 	$(CXX) $(CXXFLAGS) ../../../../CPP/7zip/Crypto/RandGen.cpp
-Rar20Crypto.o : ../../../../CPP/7zip/Crypto/Rar20Crypto.cpp
-	$(CXX) $(CXXFLAGS) ../../../../CPP/7zip/Crypto/Rar20Crypto.cpp
-Rar5Aes.o : ../../../../CPP/7zip/Crypto/Rar5Aes.cpp
-	$(CXX) $(CXXFLAGS) ../../../../CPP/7zip/Crypto/Rar5Aes.cpp
-RarAes.o : ../../../../CPP/7zip/Crypto/RarAes.cpp
-	$(CXX) $(CXXFLAGS) ../../../../CPP/7zip/Crypto/RarAes.cpp
 WzAes.o : ../../../../CPP/7zip/Crypto/WzAes.cpp
 	$(CXX) $(CXXFLAGS) ../../../../CPP/7zip/Crypto/WzAes.cpp
 ZipCrypto.o : ../../../../CPP/7zip/Crypto/ZipCrypto.cpp
@@ -869,8 +854,6 @@ OBJS=\
  PeHandler.o \
  PpmdHandler.o \
  QcowHandler.o \
- RarHandler.o \
- Rar5Handler.o \
  RpmHandler.o \
  SplitHandler.o \
  SquashfsHandler.o \
@@ -973,9 +956,6 @@ OBJS=\
  MyAesReg.o \
  Pbkdf2HmacSha1.o \
  RandGen.o \
- Rar20Crypto.o \
- Rar5Aes.o \
- RarAes.o \
  WzAes.o \
  ZipCrypto.o \
  ZipStrong.o \
diff --git a/CPP/7zip/CMAKE/Format7zFree/CMakeLists.txt b/CPP/7zip/CMAKE/Format7zFree/CMakeLists.txt
index 61f41f9..adc7117 100644
--- a/CPP/7zip/CMAKE/Format7zFree/CMakeLists.txt
+++ b/CPP/7zip/CMAKE/Format7zFree/CMakeLists.txt
@@ -126,8 +126,6 @@ add_library(7z MODULE
   "../../../../CPP/7zip/Archive/PeHandler.cpp"
   "../../../../CPP/7zip/Archive/PpmdHandler.cpp"
   "../../../../CPP/7zip/Archive/QcowHandler.cpp"
-  "../../../../CPP/7zip/Archive/Rar/RarHandler.cpp"
-  "../../../../CPP/7zip/Archive/Rar/Rar5Handler.cpp"
   "../../../../CPP/7zip/Archive/RpmHandler.cpp"
   "../../../../CPP/7zip/Archive/SplitHandler.cpp"
   "../../../../CPP/7zip/Archive/SquashfsHandler.cpp"
@@ -230,9 +228,6 @@ add_library(7z MODULE
   "../../../../CPP/7zip/Crypto/MyAesReg.cpp"
   "../../../../CPP/7zip/Crypto/Pbkdf2HmacSha1.cpp"
   "../../../../CPP/7zip/Crypto/RandGen.cpp"
-  "../../../../CPP/7zip/Crypto/Rar20Crypto.cpp"
-  "../../../../CPP/7zip/Crypto/Rar5Aes.cpp"
-  "../../../../CPP/7zip/Crypto/RarAes.cpp"
   "../../../../CPP/7zip/Crypto/WzAes.cpp"
   "../../../../CPP/7zip/Crypto/ZipCrypto.cpp"
   "../../../../CPP/7zip/Crypto/ZipStrong.cpp"
diff --git a/CPP/7zip/Crypto/Sha1Cls.h b/CPP/7zip/Crypto/Sha1Cls.h
index 71acbde..cde4a57 100644
--- a/CPP/7zip/Crypto/Sha1Cls.h
+++ b/CPP/7zip/Crypto/Sha1Cls.h
@@ -28,7 +28,6 @@ class CContext: public CContextBase
 {
 public:
   void Update(const Byte *data, size_t size) throw() { Sha1_Update(&_s, data, size); }
-  void UpdateRar(Byte *data, size_t size /* , bool rar350Mode */) throw() { Sha1_Update_Rar(&_s, data, size /* , rar350Mode ? 1 : 0 */); }
   void Final(Byte *digest) throw() { Sha1_Final(&_s, digest); }
 };

diff --git a/CPP/7zip/Guid.txt b/CPP/7zip/Guid.txt
index 7edab6e..cc22992 100644
--- a/CPP/7zip/Guid.txt
+++ b/CPP/7zip/Guid.txt
@@ -151,7 +151,6 @@ Handler GUIDs:

   01 Zip
   02 BZip2
-  03 Rar
   04 Arj
   05 Z
   06 Lzh
@@ -168,7 +167,6 @@ Handler GUIDs:
   C9 VDI
   CA Qcow
   CB GPT
-  CC Rar5
   CD IHex
   CE Hxs
   CF TE
diff --git a/CPP/7zip/QMAKE/Format7zFree/Format7zFree.pro b/CPP/7zip/QMAKE/Format7zFree/Format7zFree.pro
index afa36d4..93c45c7 100644
--- a/CPP/7zip/QMAKE/Format7zFree/Format7zFree.pro
+++ b/CPP/7zip/QMAKE/Format7zFree/Format7zFree.pro
@@ -137,8 +137,6 @@ SOURCES +=  \
   ../../../../CPP/7zip/Archive/PeHandler.cpp \
   ../../../../CPP/7zip/Archive/PpmdHandler.cpp \
   ../../../../CPP/7zip/Archive/QcowHandler.cpp \
-  ../../../../CPP/7zip/Archive/Rar/RarHandler.cpp \
-  ../../../../CPP/7zip/Archive/Rar/Rar5Handler.cpp \
   ../../../../CPP/7zip/Archive/RpmHandler.cpp \
   ../../../../CPP/7zip/Archive/SplitHandler.cpp \
   ../../../../CPP/7zip/Archive/SquashfsHandler.cpp \
@@ -241,9 +239,6 @@ SOURCES +=  \
   ../../../../CPP/7zip/Crypto/MyAesReg.cpp \
   ../../../../CPP/7zip/Crypto/Pbkdf2HmacSha1.cpp \
   ../../../../CPP/7zip/Crypto/RandGen.cpp \
-  ../../../../CPP/7zip/Crypto/Rar20Crypto.cpp \
-  ../../../../CPP/7zip/Crypto/Rar5Aes.cpp \
-  ../../../../CPP/7zip/Crypto/RarAes.cpp \
   ../../../../CPP/7zip/Crypto/WzAes.cpp \
   ../../../../CPP/7zip/Crypto/ZipCrypto.cpp \
   ../../../../CPP/7zip/Crypto/ZipStrong.cpp \
diff --git a/CPP/7zip/QMAKE/all.pro b/CPP/7zip/QMAKE/all.pro
index a565ba8..6668619 100644
--- a/CPP/7zip/QMAKE/all.pro
+++ b/CPP/7zip/QMAKE/all.pro
@@ -4,7 +4,6 @@ SUBDIRS = 7za \
           7zr \
           7z_ \
           Format7zFree \
-          Rar \
           Lzham \
           test_lib

diff --git a/CPP/7zip/UI/Client7z/Client7z.cpp b/CPP/7zip/UI/Client7z/Client7z.cpp
index d0eca6d..7f4e6e2 100644
--- a/CPP/7zip/UI/Client7z/Client7z.cpp
+++ b/CPP/7zip/UI/Client7z/Client7z.cpp
@@ -32,7 +32,7 @@ HINSTANCE g_hInstance = 0;
 #endif

 // Tou can find the list of all GUIDs in Guid.txt file.
-// use another CLSIDs, if you want to support other formats (zip, rar, ...).
+// use another CLSIDs, if you want to support other formats (zip, ...).
 // {23170F69-40C1-278A-1000-000110070000}

 DEFINE_GUID(CLSID_CFormat7z,
diff --git a/CPP/7zip/UI/Common/LoadCodecs.h b/CPP/7zip/UI/Common/LoadCodecs.h
index ac9eeac..076bd1c 100644
--- a/CPP/7zip/UI/Common/LoadCodecs.h
+++ b/CPP/7zip/UI/Common/LoadCodecs.h
@@ -158,7 +158,6 @@ struct CArcInfoEx
   void AddExts(const UString &ext, const UString &addExt);

   bool IsSplit() const { return StringsAreEqualNoCase_Ascii(Name, "Split"); }
-  // bool IsRar() const { return StringsAreEqualNoCase_Ascii(Name, "Rar"); }

   CArcInfoEx():
       Flags(0),
diff --git a/CPP/7zip/UI/Common/OpenArchive.cpp b/CPP/7zip/UI/Common/OpenArchive.cpp
index 7d5b0c4..88ea5ab 100644
--- a/CPP/7zip/UI/Common/OpenArchive.cpp
+++ b/CPP/7zip/UI/Common/OpenArchive.cpp
@@ -1063,7 +1063,6 @@ static const char * const k_Formats_with_simple_signuature[] =
 {
     "7z"
   , "xz"
-  , "rar"
   , "bzip2"
   , "gzip"
   , "cab"
@@ -1720,29 +1719,6 @@ HRESULT CArc::OpenStream2(const COpenOptions &op)
         {
           // signature search was here
         }
-        else if (extension.IsEqualTo("000") || extension.IsEqualTo("001"))
-        {
-          int i = FindFormatForArchiveType(op.codecs, orderIndices, "rar");
-          if (i >= 0)
-          {
-            const size_t kBufSize = (1 << 10);
-            byteBuffer.Alloc(kBufSize);
-            size_t processedSize = kBufSize;
-            RINOK(ReadStream(op.stream, byteBuffer, &processedSize));
-            if (processedSize >= 16)
-            {
-              const Byte *buf = byteBuffer;
-              const Byte kRarHeader[] = { 0x52 , 0x61, 0x72, 0x21, 0x1a, 0x07, 0x00 };
-              if (TestSignature(buf, kRarHeader, 7) && buf[9] == 0x73 && (buf[10] & 1) != 0)
-              {
-                orderIndices2.Add(orderIndices[i]);
-                orderIndices[i] = -1;
-                if (i >= (int)numFinded)
-                  numFinded++;
-              }
-            }
-          }
-        }
         else
         {
           const size_t kBufSize = (1 << 10);
diff --git a/CPP/7zip/UI/FileManager/FM_rc.cpp b/CPP/7zip/UI/FileManager/FM_rc.cpp
index 83578ed..034feed 100644
--- a/CPP/7zip/UI/FileManager/FM_rc.cpp
+++ b/CPP/7zip/UI/FileManager/FM_rc.cpp
@@ -821,8 +821,6 @@ REGISTER_STRINGTABLE(g_stringTable)

 /////////////////////////////////////////////////////

-#include "res/ParentFolder.h"
-
 	SevenZipPanel::SevenZipPanel(MyFrame *frame, wxWindow *parent,int id,int panelIndex) :
 	       	wxPanel(parent,id) , m_frame(frame), _wList(0)
 	{
@@ -840,7 +838,7 @@ REGISTER_STRINGTABLE(g_stringTable)
 		int sizes[] = {150, 250, 350, -1};
 		wxArrayString pathArray;
 		wxBoxSizer *pPathSizer = new wxBoxSizer(wxHORIZONTAL);
-		m_pBmpButtonParentFolder = new wxBitmapButton(this, kParentFolderID, wxGetBitmapFromMemory(PARENT_FOLDER), wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW);
+		m_pBmpButtonParentFolder = new wxBitmapButton(this, kParentFolderID, wxArtProvider::GetBitmap(wxART_GO_DIR_UP, wxART_TOOLBAR, wxDefaultSize), wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW);
 		m_pComboBoxPath = new wxComboBox(this, _comboBoxID, wxEmptyString, wxDefaultPosition, wxSize(300,-1), pathArray, wxCB_DROPDOWN | wxCB_SORT );
 		pPathSizer->Add(m_pBmpButtonParentFolder, 0, wxALL|wxEXPAND, 0);
 		pPathSizer->Add(m_pComboBoxPath, 1, wxALL|wxEXPAND, 5);
diff --git a/CPP/ANDROID/Format7zFree/jni/Android.mk b/CPP/ANDROID/Format7zFree/jni/Android.mk
index 7c74e73..48cb4fa 100644
--- a/CPP/ANDROID/Format7zFree/jni/Android.mk
+++ b/CPP/ANDROID/Format7zFree/jni/Android.mk
@@ -91,8 +91,6 @@ LOCAL_SRC_FILES := \
   ../../../../CPP/7zip/Archive/PeHandler.cpp \
   ../../../../CPP/7zip/Archive/PpmdHandler.cpp \
   ../../../../CPP/7zip/Archive/QcowHandler.cpp \
-  ../../../../CPP/7zip/Archive/Rar/RarHandler.cpp \
-  ../../../../CPP/7zip/Archive/Rar/Rar5Handler.cpp \
   ../../../../CPP/7zip/Archive/RpmHandler.cpp \
   ../../../../CPP/7zip/Archive/SplitHandler.cpp \
   ../../../../CPP/7zip/Archive/SquashfsHandler.cpp \
@@ -195,9 +193,6 @@ LOCAL_SRC_FILES := \
   ../../../../CPP/7zip/Crypto/MyAesReg.cpp \
   ../../../../CPP/7zip/Crypto/Pbkdf2HmacSha1.cpp \
   ../../../../CPP/7zip/Crypto/RandGen.cpp \
-  ../../../../CPP/7zip/Crypto/Rar20Crypto.cpp \
-  ../../../../CPP/7zip/Crypto/Rar5Aes.cpp \
-  ../../../../CPP/7zip/Crypto/RarAes.cpp \
   ../../../../CPP/7zip/Crypto/WzAes.cpp \
   ../../../../CPP/7zip/Crypto/ZipCrypto.cpp \
   ../../../../CPP/7zip/Crypto/ZipStrong.cpp \
diff --git a/ChangeLog b/ChangeLog
index daabd8e..f2a01d6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -28,7 +28,6 @@ Version 16.00 (never published)
       - 7z update bcj bugs were fixed.
       - split (aaa.001) fixed
       - iso loop fix
-      - rar4 multivol -stdin kpidSize
       - drag and drop 1<2.txt
       - memory access violation fix

@@ -80,11 +79,6 @@ Version 15.12 (never published)
     - "There are no errors" string after "Test" operation inside archive.
     - The bugs in LZMA SDK were fixed (but these bugs are not related directly to 7-Zip's code).

-
-  - From Windows version of 7-Zip 15.11 :
-        - Some bugs were fixed.
-        - 7-Zip 15.10 showed incorrect error message about missing volume for multivolume RAR archives.
-
    - ..../LZHAM added

@@ -104,9 +98,6 @@ Version 15.10 beta
 	  version (-m switch).
     - Some bugs were fixed.
       - extracting from solid wim archives worked incorrectly in some cases,
-    - Also there are some minor changes.
-      - 7-Zip can show the name of missing volume for multivolume RAR and VMDK archives.
-      - Some internal changes with 7-Zip Benchmark.

 Version 15.09 beta
 ==================
@@ -128,8 +119,6 @@ Version 15.08 beta
 Version 15.07 beta
 ==================

-  - "bin/Codecs/Rar29.so" renamed to "bin/Codecs/Rar.so"
-
   - support for cygwin 64 bits

   - support for cygwin 64 bits with asm
@@ -153,15 +142,12 @@ Version 15.07 beta

   - From Windows version of 7-zip 15.06 beta:

-    - 7-Zip now can extract RAR5 archives.
     - 7-Zip now doesn't sort files by type while adding to solid 7z archive.
       new -mqs switch to sort files by type while adding to solid 7z archive.
     - The BUG in 7-Zip File Manager was fixed:
       The "Move" operation to open 7z archive didn't delete empty files.
     - The BUG in 15.05 was fixed:
       console version added some text to the end of stdout stream, is -so switch was used.
-    - The BUG in 9.30 - 15.05 was fixed:
-      7-Zip could not open multivolume sfx RAR archive.
     - Some bugs were fixed.

   - From Windows version of 7-zip 15.05 beta:
@@ -214,9 +200,6 @@ Version 9.38
   - bug #139 "password from commanline is visible in processes list"
       Now the characters of the password are replaced with *.

-  - From Windows version of 7-zip
-     - bug#138 If you extract the password with # program crashes
-       7z now supports long password in RAR 3 and 4.

@@ -247,12 +230,6 @@ Version 9.22
   - #3283518 : Asm/x{32,64}/7zCrcT8U.asm introduces executable stack

-Version 9.20.1
-==============
-
-  - #3211479 "p7zip 9.20 - "unsupported method" with RAR files - " fixed
-    "install.sh" installs again "bin/Codecs/Rar29.so"
-
 Version 9.20
 ============

@@ -325,8 +302,6 @@ Version 9.13
     - Some bugs were fixed.

-  - #2863580 "Crash in Rar decoder on a corrupted file" fixed
-
   - #2860898 "Dereferencing a zero pointer in cab handler" fixed

   - #2860679 "Division by zero in cab decoder" fixed
@@ -455,7 +430,7 @@ Version 4.59 (never published)
     - It's allowed to use -t switch for "list" and "extract" commands.
     - Some bugs were fixed.

-  - Bug : wrong timestamp for files extracted from .zip or .rar archives
+  - Bug : wrong timestamp for files extracted from .zip archives

 Version 4.58
@@ -468,8 +443,6 @@ Version 4.58
         2) -mcu switch:  7-Zip uses UTF-8, if there are non-ASCII symbols.
         3) -mcl switch:  7-Zip uses local code page.
     - Now it's possible to store file creation time in 7z and ZIP archives (-mtc switch).
-    - 7-Zip now can unpack multivolume RAR archives created with
-      "old style volume names" scheme and names *.001, *.002, ...
     - Now it's possible to use -mSW- and -mSW+ switches instead of -mSW=off and -mSW=on
     - Some bugs were fixed.

@@ -685,7 +658,7 @@ Version 4.44

   - From Windows version of 7-zip 4.44 :
     - 7za : Cab support
-    - Speed optimizations for LZMA, Deflate, BZip2 and unRAR.
+    - Speed optimizations for LZMA, Deflate and BZip2.
     - fix : now, updating a crypted header archive keeps the crypted header

   - fixes in the help displayed by 7za/7z/7zr.
@@ -805,8 +778,6 @@ Version 4.38

   - patch #1465026 - Patch for install.sh for packagers

-  - DosDateTimeToFileTime fixed (rar format)
-
   - contrib/VirtualFileSystemForMidnightCommander/u7z updated
     (thank sgh_punk)

@@ -923,8 +894,6 @@ Version 4.25
     - Some bugs were fixed
     - DOCS/MANUAL/exit_codes.htm added

-  - new plugin for 7z : RAR format support (extracting only)
-
   - better dependencies in makefile

 Version 4.23
@@ -1112,9 +1081,6 @@ Version 4.10
   - new port of 7za from the source of 7za 4.10Beta for Windows
     => p7zip now work on big endian CPU.

-  - 7z for Unix is not maintain anymore (because as the source of unrar plugin for 7z
-    is not available, 7z is unless on Unix).
-
 Version 0.91
 ============
   - add support for FreeBSD 5.2.1
diff --git a/DOC/License.txt b/DOC/License.txt
index 0bcbe26..5b0dfaa 100644
--- a/DOC/License.txt
+++ b/DOC/License.txt
@@ -5,15 +5,6 @@

   7-Zip Copyright (C) 1999-2016 Igor Pavlov.

-  Licenses for files are:
-
-    1) CPP/7zip/Compress/Rar* files:  GNU LGPL + unRAR restriction
-    2) All other files:  GNU LGPL
-
-  The GNU LGPL + unRAR restriction means that you must follow both
-  GNU LGPL rules and unRAR restriction rules.
-
-
   GNU LGPL information
   --------------------

@@ -33,21 +24,5 @@
     USA

-  unRAR restriction
-  -----------------
-
-    The decompression engine for RAR archives was developed using source
-    code of unRAR program.
-    All copyrights to original unRAR code are owned by Alexander Roshal.
-
-    The license for original unRAR code has the following restriction:
-
-    The unRAR sources cannot be used to re-create the RAR compression algorithm,
-    which is proprietary. Distribution of modified unRAR sources in separate form
-    or as a part of other software is permitted, provided that it is clearly
-    stated in the documentation and source comments that the code may
-    not be used to develop a RAR (WinRAR) compatible archiver.
-
-
   --
   Igor Pavlov
diff --git a/DOC/MANUAL/cmdline/switches/update.htm b/DOC/MANUAL/cmdline/switches/update.htm
index 27385b1..0190fc1 100644
--- a/DOC/MANUAL/cmdline/switches/update.htm
+++ b/DOC/MANUAL/cmdline/switches/update.htm
@@ -139,7 +139,7 @@ someone in another time zone.</P>
 <LI>UTC file systems: NTFS
 <LI>UTC archive formats: .zip with -mtc switch, 7z, tar, gzip2, iso, wim
 <LI>Local time file systems : FAT, FAT32
-<LI>Local time archive formats : rar, zip, cab
+<LI>Local time archive formats : zip, cab
 </UL>

 <H4>Examples</H4>
diff --git a/DOC/MANUAL/general/formats.htm b/DOC/MANUAL/general/formats.htm
index 7996c5c..cd01bd6 100644
--- a/DOC/MANUAL/general/formats.htm
+++ b/DOC/MANUAL/general/formats.htm
@@ -47,7 +47,6 @@
   <TR> <TD align="center">NSIS</TD> <TD></TD> <TD>nsis</TD> </TR>
   <TR> <TD align="center">NTFS</TD> <TD></TD> <TD>ntfs img</TD> </TR>
   <TR> <TD align="center">MBR</TD> <TD></TD> <TD>mbr</TD> </TR>
-  <TR> <TD align="center">RAR</TD> <TD></TD> <TD>rar r00</TD> </TR>
   <TR> <TD align="center">RPM</TD>  <TD></TD> <TD>rpm</TD></TR>
   <TR> <TD align="center">PPMD</TD> <TD></TD> <TD>ppmd</TD> </TR>
   <TR> <TD align="center">QCOW2</TD> <TD></TD> <TD>qcow qcow2 qcow2c</TD> </TR>
diff --git a/DOC/Methods.txt b/DOC/Methods.txt
index 1a1c54c..daa94e2 100644
--- a/DOC/Methods.txt
+++ b/DOC/Methods.txt
@@ -97,12 +97,6 @@ List of defined IDs
    02 -
       02 - BZip2

-   03 - [Rar]
-      01 - Rar1
-      02 - Rar2
-      03 - Rar3
-      05 - Rar5
-
    04 - [Arj]
       01 - Arj(1,2,3)
       02 - Arj4
@@ -146,10 +140,6 @@ List of defined IDs
       01 - [Zip]
          01 - ZipCrypto (Main Zip crypto algo)

-      03 - [RAR]
-         02 -
-         03 - Rar29AES (AES-128 + modified SHA-1)
-
       07 - [7z]
          01 - 7zAES (AES-256 + SHA-256)

diff --git a/DOC/readme.txt b/DOC/readme.txt
index 4a6998c..00591d4 100644
--- a/DOC/readme.txt
+++ b/DOC/readme.txt
@@ -9,30 +9,9 @@
 License Info
 ------------

-7-Zip is free software distributed under the GNU LGPL
-(except for unRar code).
+7-Zip is free software distributed under the GNU LGPL.
 read License.txt for more infomation about license.

-Notes about unRAR license:
-
-Please check main restriction from unRar license:
-
-   2. The unRAR sources may be used in any software to handle RAR
-      archives without limitations free of charge, but cannot be used
-      to re-create the RAR compression algorithm, which is proprietary.
-      Distribution of modified unRAR sources in separate form or as a
-      part of other software is permitted, provided that it is clearly
-      stated in the documentation and source comments that the code may
-      not be used to develop a RAR (WinRAR) compatible archiver.
-
-In brief it means:
-1) You can compile and use compiled files under GNU LGPL rules, since
-   unRAR license almost has no restrictions for compiled files.
-   You can link these compiled files to LGPL programs.
-2) You can fix bugs in source code and use compiled fixed version.
-3) You can not use unRAR sources to re-create the RAR compression algorithm.
-
-
 LZMA SDK
 --------

@@ -96,7 +75,6 @@ DOC                Documentation
 ---
   7zFormat.txt   - 7z format description
   copying.txt    - GNU LGPL license
-  unRarLicense.txt - License for unRAR part of source code
   src-history.txt  - Sources history
   Methods.txt    - Compression method IDs
   readme.txt     - Readme file
diff --git a/DOC/src-history.txt b/DOC/src-history.txt
index 6b48c80..dda8057 100644
--- a/DOC/src-history.txt
+++ b/DOC/src-history.txt
@@ -188,8 +188,6 @@ HISTORY of the 7-Zip source code
 - 7-Zip now has 128 MB dictionary limit for 32-bit version:
   It's for speed optimization: kNumLogBits = 9 + sizeof(size_t) / 2;
 - TAR: 'D' link flag support.
-- 7-Zip now can unpack multivolume RAR archives created with
-  "old style volume names" scheme (-vn switch) and names *.001, *.002, ...
 - Fixed bugs:
   - 7-Zip FM could not copy / move files to root network folders like \\COMPNAME\FOLDERNAME\
     In case of move it removed original files.
@@ -200,8 +198,6 @@ HISTORY of the 7-Zip source code
       7-zip tries to delete all extra fileds (except for WzAES).
       And that code could hang.
   -  7-Zip GUI didn't suggest BZip2 dictionary size used in previous run.
-  -  If creation time stamp was included in .RAR archive, 7-zip used creation time stamp
-     as modification time stamp.

 4.58 alpha 2   2007-12-31
 -------------------------
@@ -251,7 +247,6 @@ HISTORY of the 7-Zip source code
   stratup code, or you must add CPP/Common/CRC.cpp to your project.
 - Method ID in .7z now is 63-bit integer (UInt64).
 - Open error messages
-- unRar 1.5 fixed
 - unShrink fixed
 - BUG of 4.43 beta and 4.44 beta was fixed.
   7-Zip compressing to .zip in multi-threading mode didn't work in some cases.
@@ -433,11 +428,6 @@ HISTORY of the 7-Zip source code
     contains common resurces

-2.30 Beta 19   2002-04-11
--------------------------
-- SDK/Archive/Rar/Handler.cpp
-    supporting RAR29
-
 2.30 Beta 18   2002-03-25
 -------------------------
 - SDK/Archive/Cab/MSZipDecoder.cpp
diff --git a/GUI/Contents/Info.plist b/GUI/Contents/Info.plist
index 71650e1..d60b262 100644
--- a/GUI/Contents/Info.plist
+++ b/GUI/Contents/Info.plist
@@ -311,24 +311,6 @@
 		<dict>
 			<key>CFBundleTypeExtensions</key>
 			<array>
-				<string>rar</string>
-				<string>RAR</string>
-				<string>.r00</string>
-			</array>
-			<key>CFBundleTypeIconFile</key>
-			<string>p7zip</string>
-			<key>CFBundleTypeName</key>
-			<string>Rar</string>
-			<key>CFBundleTypeRole</key>
-			<string>Viewer</string>
-			<key>LSTypeIsPackage</key>
-			<false/>
-			<key>NSPersistentStoreTypeKey</key>
-			<string>XML</string>
-		</dict>
-		<dict>
-			<key>CFBundleTypeExtensions</key>
-			<array>
 				<string>ace</string>
 				<string>ACE</string>
 				<string>.c00</string>
diff --git a/README b/README
index b76407f..c03917b 100644
--- a/README
+++ b/README
@@ -8,7 +8,7 @@ p7zip is a port of the Windows programs 7z.exe and 7za.exe provided by 7-zip.
 7-zip is a file archiver with the highest compression ratio.
 Homepage : www.7-zip.org

-  7z uses plugins (7z.so and Codecs/Rar.so) to handle archives.
+  7z uses plugins (7z.so) to handle archives.
   7za is a stand-alone executable (7za handles less archive formats than 7z).
   7zr is a light stand-alone executable that supports only 7z/LZMA/BCJ/BCJ2.

@@ -63,7 +63,6 @@ BUILD :
     make sfx      : to build bin/7zCon.sfx (7za can now create SFX archive)
     make 7z       : to build bin/7z and its plugins :
                           - "bin/7z.so" (GNU LGPL + AES code license)
-                          - "bin/Codecs/Rar.so" (GNU LGPL + unRAR restriction)
     make 7zr      : to build bin/7zr
     make all      : to build bin/7za and bin/7zCon.sfx
     make all2     : to build bin/7za, bin/7z (with its plugins) and bin/7zCon.sfx
@@ -74,7 +73,6 @@ BUILD :

     make 7zG      : to build bin/7zG and its plugins :
                           - "bin/7z.so" (GNU LGPL + AES code license)
-                          - "bin/Codecs/Rar.so" (GNU LGPL + unRAR restriction)
     make test_7zG : to test bin/7zG (extracting, archiving, ...)

diff --git a/Utils/bin_to_sources.py b/Utils/bin_to_sources.py
index 1be72ec..7da359a 100644
--- a/Utils/bin_to_sources.py
+++ b/Utils/bin_to_sources.py
@@ -13,9 +13,6 @@ file0='Utils/file_7zCon_sfx.py'
 dir0='CPP/7zip/UI/Console'
 file0='Utils/file_7z.py'

-dir0='CPP/7zip/Compress/Rar'
-file0='Utils/file_Codecs_Rar_so.py'
-
 dir0='CPP/7zip/Bundles/Format7zFree'
 file0='Utils/file_7z_so.py'

diff --git a/Utils/file_7z_so.py b/Utils/file_7z_so.py
index 7ca9fff..43edb87 100644
--- a/Utils/file_7z_so.py
+++ b/Utils/file_7z_so.py
@@ -111,8 +111,6 @@ files_cpp=[
  'CPP/7zip/Archive/PeHandler.cpp',
  'CPP/7zip/Archive/PpmdHandler.cpp',
  'CPP/7zip/Archive/QcowHandler.cpp',
- 'CPP/7zip/Archive/Rar/RarHandler.cpp',
- 'CPP/7zip/Archive/Rar/Rar5Handler.cpp',
  'CPP/7zip/Archive/RpmHandler.cpp',
  'CPP/7zip/Archive/SplitHandler.cpp',
  'CPP/7zip/Archive/SquashfsHandler.cpp',
@@ -215,9 +213,6 @@ files_cpp=[
  'CPP/7zip/Crypto/MyAesReg.cpp',
  'CPP/7zip/Crypto/Pbkdf2HmacSha1.cpp',
  'CPP/7zip/Crypto/RandGen.cpp',
- 'CPP/7zip/Crypto/Rar20Crypto.cpp',
- 'CPP/7zip/Crypto/Rar5Aes.cpp',
- 'CPP/7zip/Crypto/RarAes.cpp',
  'CPP/7zip/Crypto/WzAes.cpp',
  'CPP/7zip/Crypto/ZipCrypto.cpp',
  'CPP/7zip/Crypto/ZipStrong.cpp',
diff --git a/Utils/generate.py b/Utils/generate.py
index 132024a..62c0456 100755
--- a/Utils/generate.py
+++ b/Utils/generate.py
@@ -281,7 +281,6 @@ import file_7zr
 import file_7zG
 import file_7zFM
 import file_7z_so
-import file_Codecs_Rar_so
 import file_Codecs_Lzham_so
 import file_LzmaCon
 import file_Client7z
@@ -440,43 +439,6 @@ LOCAL_CFLAGS := -DANDROID_NDK  -fexceptions \
 -I../../../include_windows
 ''')

-project_Codecs_Rar=Structure(name="Rar",name2="Rar",
-	type=TYPE_DLL,
-	need_AES=False,
-	includedirs=includedirs_7za,
-	defines=[ "EXTERNAL_CODECS", "_FILE_OFFSET_BITS=64", "_LARGEFILE_SOURCE", "_REENTRANT", "ENV_UNIX", "BREAK_HANDLER", "UNICODE", "_UNICODE", "UNIX_USE_WIN_FILE" ],
-	files_c=file_Codecs_Rar_so.files_c,
-	files_cpp=file_Codecs_Rar_so.files_cpp,
-	cmake_end='''
-
-find_library(DL_LIB dl)
-
-link_directories(${DL_LIB_PATH})
-
-IF(APPLE)
-   TARGET_LINK_LIBRARIES(Rar ${COREFOUNDATION_LIBRARY} ${CMAKE_THREAD_LIBS_INIT})
-ELSE(APPLE)
-  IF(HAVE_PTHREADS)
-   TARGET_LINK_LIBRARIES(Rar ${CMAKE_THREAD_LIBS_INIT} dl)
-  ENDIF(HAVE_PTHREADS)
-ENDIF(APPLE)
-
-''',
-android_header=r'''
-LOCAL_CFLAGS := -DANDROID_NDK  -fexceptions \
-	-DNDEBUG -D_REENTRANT -DENV_UNIX \
-	-DEXTERNAL_CODECS \
-	-DBREAK_HANDLER \
-	-DUNICODE -D_UNICODE -DUNIX_USE_WIN_FILE \
-	-I../../../Windows \
-	-I../../../Common \
-	-I../../../../C \
--I../../../myWindows \
--I../../../ \
--I../../../include_windows
-''')
-
-

 project_Codecs_Lzham=Structure(name="Lzham",name2="Lzham",
 	type=TYPE_DLL,
@@ -762,7 +724,6 @@ generate_makefile_list('../CPP/7zip/Bundles/Alone/makefile.list',project_7za)
 generate_makefile_list('../CPP/7zip/Bundles/Alone7z/makefile.list',project_7zr)
 generate_makefile_list('../CPP/7zip/UI/Console/makefile.list',project_7z)
 generate_makefile_list('../CPP/7zip/Bundles/Format7zFree/makefile.list',project_Format7zFree)
-generate_makefile_list('../CPP/7zip/Compress/Rar/makefile.list',project_Codecs_Rar,'../../../../bin/Codecs')
 generate_makefile_list('../CPP/7zip/Compress/Lzham/makefile.list',project_Codecs_Lzham,'../../../../bin/Codecs')
 generate_makefile_list('../CPP/7zip/Bundles/SFXCon/makefile.list',project_7zCon_sfx)
 generate_makefile_list('../CPP/7zip/UI/GUI/makefile.list',project_7zG)
@@ -776,7 +737,6 @@ generate_pro('../CPP/7zip/QMAKE/7za/7za.pro',project_7za)
 generate_pro('../CPP/7zip/QMAKE/7zr/7zr.pro',project_7zr)
 generate_pro('../CPP/7zip/QMAKE/7z_/7z_.pro',project_7z)
 generate_pro('../CPP/7zip/QMAKE/Format7zFree/Format7zFree.pro',project_Format7zFree)
-generate_pro('../CPP/7zip/QMAKE/Rar/Rar.pro',project_Codecs_Rar)
 generate_pro('../CPP/7zip/QMAKE/Lzham/Lzham.pro',project_Codecs_Lzham)

 generate_premake4('../CPP/7zip/PREMAKE/premake4.lua',project_7za)
diff --git a/contrib/qnx630sp3/qnx630sp3-shared b/contrib/qnx630sp3/qnx630sp3-shared
index 6f5481f..ea07114 100644
--- a/contrib/qnx630sp3/qnx630sp3-shared
+++ b/contrib/qnx630sp3/qnx630sp3-shared
@@ -8,7 +8,7 @@ mv ./bin/7z ../${BIN} && mv ./bin/7za ../${BIN} && mv ./bin/7zr ../${BIN} && mv
 make clean && \
 cp makefile.qnx_shared.so makefile.machine && \
 make 7z && \
-mv ./bin/7z.so ../${BIN} && mv ./bin/Codecs/Rar.so ../${BIN}/Codecs && \
+mv ./bin/7z.so ../${BIN} && \
 make clean && \
 mv makefile.machine.bak makefile.machine
 echo "All done - look for binaries in ../${BIN}"
diff --git a/makefile b/makefile
index 745c8ed..f8e8e33 100644
--- a/makefile
+++ b/makefile
@@ -31,7 +31,6 @@ depend:
 	$(MAKE) -C CPP/7zip/UI/Client7z           depend
 	$(MAKE) -C CPP/7zip/UI/Console            depend
 	$(MAKE) -C CPP/7zip/Bundles/Format7zFree  depend
-	$(MAKE) -C CPP/7zip/Compress/Rar          depend
 	$(MAKE) -C CPP/7zip/UI/GUI                depend
 	$(MAKE) -C CPP/7zip/UI/FileManager        depend

@@ -42,7 +41,6 @@ sfx: common
 common7z:common
 	$(MKDIR) bin/Codecs
 	$(MAKE) -C CPP/7zip/Bundles/Format7zFree all
-	$(MAKE) -C CPP/7zip/Compress/Rar         all

 lzham:common
 	$(MKDIR) bin/Codecs
@@ -67,7 +65,6 @@ clean_C:
 	$(MAKE) -C CPP/7zip/UI/FileManager       clean
 	$(MAKE) -C CPP/7zip/UI/GUI               clean
 	$(MAKE) -C CPP/7zip/Bundles/Format7zFree clean
-	$(MAKE) -C CPP/7zip/Compress/Rar         clean
 	$(MAKE) -C CPP/7zip/Compress/Lzham       clean
 	$(MAKE) -C CPP/7zip/Bundles/LzmaCon      clean2
 	$(MAKE) -C CPP/7zip/Bundles/AloneGCOV    clean
diff --git a/makefile.oldmake b/makefile.oldmake
index afc681c..690af08 100644
--- a/makefile.oldmake
+++ b/makefile.oldmake
@@ -31,7 +31,6 @@ depend:
 	cd CPP/7zip/UI/Client7z           ; $(MAKE) depend
 	cd CPP/7zip/UI/Console            ; $(MAKE) depend
 	cd CPP/7zip/Bundles/Format7zFree  ; $(MAKE) depend
-	cd CPP/7zip/Compress/Rar          ; $(MAKE) depend
 	cd CPP/7zip/UI/GUI                ; $(MAKE) depend
 	cd CPP/7zip/UI/FileManager        ; $(MAKE) depend

@@ -42,7 +41,6 @@ sfx: common
 common7z:common
 	$(MKDIR) bin/Codecs
 	cd CPP/7zip/Bundles/Format7zFree ; $(MAKE) all
-	cd CPP/7zip/Compress/Rar         ; $(MAKE) all

 lzham:common
 	$(MKDIR) bin/Codecs
@@ -67,7 +65,6 @@ clean_C:
 	cd CPP/7zip/UI/FileManager       ; $(MAKE) clean
 	cd CPP/7zip/UI/GUI               ; $(MAKE) clean
 	cd CPP/7zip/Bundles/Format7zFree ; $(MAKE) clean
-	cd CPP/7zip/Compress/Rar         ; $(MAKE) clean
 	cd CPP/7zip/Compress/Lzham       ; $(MAKE) clean
 	cd CPP/7zip/Bundles/LzmaCon      ; $(MAKE) clean2
 	cd CPP/7zip/Bundles/AloneGCOV    ; $(MAKE) clean
diff --git a/makefile.qnx_shared.so b/makefile.qnx_shared.so
index abd1caf..cff5485 100644
--- a/makefile.qnx_shared.so
+++ b/makefile.qnx_shared.so
@@ -1,5 +1,5 @@
 ###################################################
-# makefile.machine for "7z.so , Codecs/Rar.so" :
+# makefile.machine for "7z.so" :
 # tested with p7zip-4.47_beta on qnx-6.3.0 sp3 x86 target

 OPTFLAGS=-O -s


code:
Fix CVE-2020-10595:

https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-10595

Patch copied from upstream advisory:

https://seclists.org/oss-sec/2020/q1/128

diff --git a/prompting.c b/prompting.c
index e985d95..d81054f 100644
--- a/prompting.c
+++ b/prompting.c
@@ -314,26 +314,27 @@ pamk5_prompter_krb5(krb5_context context UNUSED, void *data, const char *name,
     /*
      * Reuse pam_prompts as a starting index and copy the data into the reply
      * area of the krb5_prompt structs.
      */
     pam_prompts = 0;
     if (name != NULL && !args->silent)
         pam_prompts++;
     if (banner != NULL && !args->silent)
         pam_prompts++;
     for (i = 0; i < num_prompts; i++, pam_prompts++) {
-        size_t len;
+        size_t len, allowed;

         if (resp[pam_prompts].resp == NULL)
             goto cleanup;
         len = strlen(resp[pam_prompts].resp);
-        if (len > prompts[i].reply->length)
+        allowed = prompts[i].reply->length;
+        if (allowed == 0 || len > allowed - 1)
             goto cleanup;

         /*
          * The trailing nul is not included in length, but other applications
          * expect it to be there.  Therefore, we copy one more byte than the
          * actual length of the password, but set length to just the length of
          * the password.
          */
         memcpy(prompts[i].reply->data, resp[pam_prompts].resp, len + 1);
         prompts[i].reply->length = (unsigned int) len;


code:
Skip Thai character test when libthai is unavailable.

Taken from upstream bug tracker:
https://gitlab.gnome.org/GNOME/pango/merge_requests/161
https://gitlab.gnome.org/GNOME/pango/commit/b73284747ac937e31dc9191f84ed6e24284c88ee

diff --git a/tests/test-break.c b/tests/test-break.c
index 8549b678bba69360d07dce3af21d915412f20d51..47fa3009165e19a331aa04a0df4351ae2323933b 100644
--- a/tests/test-break.c
+++ b/tests/test-break.c
@@ -305,6 +305,12 @@ main (int argc, char *argv[])
       if (!strstr (name, "break"))
         continue;

+#ifndef HAVE_LIBTHAI
+      /* four.break involves Thai, so only test it when we have libthai */
+      if (strstr (name, "four.break"))
+        continue;
+#endif
+
       path = g_strdup_printf ("/break/%s", name);
       g_test_add_data_func_full (path, g_test_build_filename (G_TEST_DIST, "breaks", name, NULL),
                                  test_break, g_free);


code:
See <http://lists.gnu.org/archive/html/bug-patch/2015-06/msg00009.html>

From 0507dfad5f060161f01840067e1bb1615257b636 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= <ludo@gnu.org>
Date: Mon, 8 Jun 2015 17:27:56 +0200
Subject: [PATCH] Do not rely on PATH_MAX when reading a symlink target.

* src/util.c (move_file, copy_file): Use 'fromst->st_size + 1' and
'tost->st_size + 1' for the allocation, and 'fromst->st_size' and
'tost->st_size' instead of PATH_MAX.  Fixes compilation on GNU/Hurd.
---
 src/util.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/util.c b/src/util.c
index 1cc08ba..67dbd3a 100644
--- a/src/util.c
+++ b/src/util.c
@@ -460,12 +460,12 @@ move_file (char const *from, bool *from_needs_removal,

 	  /* FROM contains the contents of the symlink we have patched; need
 	     to convert that back into a symlink. */
-	  char *buffer = xmalloc (PATH_MAX);
+	  char *buffer = xmalloc (fromst->st_size + 1);
 	  int fd, size = 0, i;

 	  if ((fd = safe_open (from, O_RDONLY | O_BINARY, 0)) < 0)
 	    pfatal ("Can't reopen file %s", quotearg (from));
-	  while ((i = read (fd, buffer + size, PATH_MAX - size)) > 0)
+	  while ((i = read (fd, buffer + size, fromst->st_size - size)) > 0)
 	    size += i;
 	  if (i != 0 || close (fd) != 0)
 	    read_fatal ();
@@ -610,10 +610,10 @@ copy_file (char const *from, char const *to, struct stat *tost,

   if (S_ISLNK (mode))
     {
-      char *buffer = xmalloc (PATH_MAX + 1);
+      char *buffer = xmalloc (tost->st_size + 1);
       ssize_t r;

-      if ((r = safe_readlink (from, buffer, PATH_MAX)) < 0)
+      if ((r = safe_readlink (from, buffer, tost->st_size)) < 0)
 	pfatal ("Can't read %s %s", "symbolic link", from);
       buffer[r] = '\0';
       if (safe_symlink (buffer, to) != 0)
--
2.16.2


code:
Need to mark one of the tests as PHONY to get permissions set correctly on
built scripts.

--- a/Makefile.in	2011-02-10 09:44:43.000000000 -0600
+++ b/Makefile.in	2018-11-29 21:52:05.000000000 -0600
@@ -1106,5 +1108,6 @@
 	rm -f $(DESTDIR)$(bindir)/"`echo lsdiff|sed '$(transform)'`"
 	rm -f $(DESTDIR)$(bindir)/"`echo grepdiff|sed '$(transform)'`"

+.PHONY: tests/newline1/run-test
 tests/newline1/run-test: src/combinediff$(EXEEXT) src/flipdiff$(EXEEXT) \
 		src/lsdiff$(EXEEXT) src/grepdiff$(EXEEXT) \
		scripts/splitdiff


code:
Add ability to detect GNU/Hurd when configuring.

Adapted from https://git.hadrons.org/cgit/debian/pkgs/pciutils.git/tree/debian/patches/00-configure-hurd.patch

From e39a3af22501234a91cf28e8c57b45f9379f9101 Mon Sep 17 00:00:00 2001
From: Damien Zammit <damien@zamaudio.com>
Date: Fri, 26 Oct 2018 09:24:04 -0400
Subject: [PATCH 2/2] Add ability to detect GNU/Hurd when configuring

---
 lib/configure |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

--- a/lib/configure
+++ b/lib/configure
@@ -25,7 +25,7 @@ if [ -z "$HOST" ] ; then
 		proc=`/usr/sbin/lsdev -C -c processor -S available -F name | head -1`
 		cpu=`/usr/sbin/lsattr -F value -l $proc -a type | sed 's/_.*//'`
 	else
-		cpu=`uname -m | sed 's/^i.86$/i386/;s/^sun4u$/sparc64/;s/^i86pc$/i386/;s/^BePC$/i386/;s/^BeMac$/powerpc/;s/^BeBox$/powerpc/'`
+		cpu=`uname -m | sed 's/^i.86-AT386/i386/;s/^i.86$/i386/;s/^sun4u$/sparc64/;s/^i86pc$/i386/;s/^BePC$/i386/;s/^BeMac$/powerpc/;s/^BeBox$/powerpc/'`
 	fi
 	if [ "$sys" = "DragonFly" ]
 	then
@@ -39,6 +39,10 @@ if [ -z "$HOST" ] ; then
 	then
 		sys=cygwin
 	fi
+	if [ "$sys" = "GNU" ]
+	then
+		sys=gnu
+	fi
 	HOST=${3:-$cpu-$sys}
 fi
 [ -n "$RELEASE" ] && rel="${RELEASE}"


code:
Fix a build error on GNU/Hurd for pciutils 3.7.0.

commit 053cf6c8b2acafadf828912828336d90fe9b8696
Author: Martin Mares <mj@ucw.cz>
Date:   Sun May 31 11:53:28 2020 +0200

    HURD backend should compile again

    Fixes a bug introduced by commit 82c06b47dea5a38075ce9d56f743360bc47b4c78.

diff --git a/lib/hurd.c b/lib/hurd.c
index 7b3b2ae..ccd92f6 100644
--- a/lib/hurd.c
+++ b/lib/hurd.c
@@ -307,7 +307,6 @@ hurd_fill_regions(struct pci_dev *d)
       d->base_addr[i] |= regions[i].is_64 << 2;
       d->base_addr[i] |= regions[i].is_prefetchable << 3;

-      if (flags & PCI_FILL_SIZES)
-	d->size[i] = regions[i].size;
+      d->size[i] = regions[i].size;
     }
 }


code:
AutoSplit will fail to create an index for files whose modification time is 0
because its default time for a non-existent index is 1.  Set this default time
to -1 instead.

--- perl-5.16.1/cpan/AutoLoader/lib/AutoSplit.pm.orig	2012-02-14 22:44:36.000000000 -0600
+++ perl-5.16.1/cpan/AutoLoader/lib/AutoSplit.pm	2015-09-09 19:59:22.208708921 -0500
@@ -361,7 +361,7 @@
     my($al_idx_file) = catfile($autodir, $modpname, $IndexFile);

     if ($check_mod_time){
-	my($al_ts_time) = (stat("$al_idx_file"))[9] || 1;
+	my($al_ts_time) = (stat("$al_idx_file"))[9] || -1;
 	if ($al_ts_time >= $pm_mod_time and
 	    $al_ts_time >= $self_mod_time){
 	    print "AutoSplit skipped ($al_idx_file newer than $filename)\n"