Add more(1).

Change-Id: I7c4707e110b43741486d988fd3600b0a434f5a8b
diff --git a/.config b/.config
index a5211a8..1955ed9 100644
--- a/.config
+++ b/.config
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
 # ToyBox version: KCONFIG_VERSION
-# Wed Dec  3 08:12:05 2014
+# Thu Dec 11 17:04:19 2014
 #
 CONFIG_TOYBOX_CONTAINER=y
 CONFIG_TOYBOX_FIFREEZE=y
@@ -135,7 +135,7 @@
 # CONFIG_MKE2FS_LABEL is not set
 # CONFIG_MKE2FS_EXTENDED is not set
 # CONFIG_MODPROBE is not set
-# CONFIG_MORE is not set
+CONFIG_MORE=y
 # CONFIG_NETSTAT is not set
 # CONFIG_NSENTER is not set
 # CONFIG_OPENVT is not set
@@ -221,6 +221,7 @@
 CONFIG_RFKILL=y
 CONFIG_RMMOD=y
 CONFIG_SETSID=y
+# CONFIG_SHRED is not set
 CONFIG_STAT=y
 CONFIG_SWAPOFF=y
 CONFIG_SWAPON=y
diff --git a/Android.mk b/Android.mk
index ccd70c3..f6bbd6e 100644
--- a/Android.mk
+++ b/Android.mk
@@ -115,6 +115,7 @@
     toys/other/vmstat.c \
     toys/other/which.c \
     toys/other/yes.c \
+    toys/pending/more.c \
     toys/posix/basename.c \
     toys/posix/cal.c \
     toys/posix/cat.c \
@@ -233,6 +234,7 @@
     md5sum \
     mkswap \
     modinfo \
+    more \
     mountpoint \
     nice \
     nl \
diff --git a/generated/config.h b/generated/config.h
index 53eff77..8092eb0 100644
--- a/generated/config.h
+++ b/generated/config.h
@@ -246,8 +246,8 @@
 #define USE_MKE2FS_EXTENDED(...)
 #define CFG_MODPROBE 0
 #define USE_MODPROBE(...)
-#define CFG_MORE 0
-#define USE_MORE(...)
+#define CFG_MORE 1
+#define USE_MORE(...) __VA_ARGS__
 #define CFG_NETSTAT 0
 #define USE_NETSTAT(...)
 #define CFG_NSENTER 0
@@ -410,6 +410,8 @@
 #define USE_RMMOD(...) __VA_ARGS__
 #define CFG_SETSID 1
 #define USE_SETSID(...) __VA_ARGS__
+#define CFG_SHRED 0
+#define USE_SHRED(...)
 #define CFG_STAT 1
 #define USE_STAT(...) __VA_ARGS__
 #define CFG_SWAPOFF 1
diff --git a/generated/flags.h b/generated/flags.h
index f1b3740..4ddd834 100644
--- a/generated/flags.h
+++ b/generated/flags.h
@@ -1514,6 +1514,19 @@
 #undef FLAG_b
 #endif
 
+// shred   <1zxus#<1n#<1o#<0f
+#ifdef CLEANUP_shred
+#undef CLEANUP_shred
+#undef FOR_shred
+#undef FLAG_f
+#undef FLAG_o
+#undef FLAG_n
+#undef FLAG_s
+#undef FLAG_u
+#undef FLAG_x
+#undef FLAG_z
+#endif
+
 // skeleton   (walrus)(blubber):;(also):e@d*c#b:a
 #ifdef CLEANUP_skeleton
 #undef CLEANUP_skeleton
@@ -3607,6 +3620,19 @@
 #define FLAG_b (1<<0)
 #endif
 
+#ifdef FOR_shred
+#ifndef TT
+#define TT this.shred
+#endif
+#define FLAG_f 0
+#define FLAG_o 0
+#define FLAG_n 0
+#define FLAG_s 0
+#define FLAG_u 0
+#define FLAG_x 0
+#define FLAG_z 0
+#endif
+
 #ifdef FOR_skeleton
 #ifndef TT
 #define TT this.skeleton
diff --git a/generated/globals.h b/generated/globals.h
index cedb0c3..d3a9566 100644
--- a/generated/globals.h
+++ b/generated/globals.h
@@ -216,6 +216,16 @@
   char *console;
 };
 
+// toys/other/shred.c
+
+struct shred_data {
+  long offset;
+  long iterations;
+  long size;
+
+  int ufd;
+};
+
 // toys/other/stat.c
 
 struct stat_data {
@@ -325,10 +335,10 @@
   // Compressed data buffer
   char *data;
   unsigned pos, len;
-  int fd;
+  int infd, outfd;
 
   // Tables only used for deflation
-  unsigned short *head, *chain;
+  unsigned short *hashhead, *hashchain;
 };
 
 // toys/pending/crond.c
@@ -1165,6 +1175,7 @@
 	struct modinfo_data modinfo;
 	struct netcat_data netcat;
 	struct oneit_data oneit;
+	struct shred_data shred;
 	struct stat_data stat;
 	struct swapon_data swapon;
 	struct switch_root_data switch_root;
diff --git a/generated/help.h b/generated/help.h
index 5075570..43cadad 100644
--- a/generated/help.h
+++ b/generated/help.h
@@ -88,6 +88,8 @@
 
 #define help_stat "usage: stat [-f] [-c FORMAT] FILE...\n\nDisplay status of files or filesystems.\n\n-f display filesystem status instead of file status\n-c Output specified FORMAT string instead of default\n\nThe valid format escape sequences for files:\n%a  Access bits (octal) |%A  Access bits (flags)|%b  Blocks allocated\n%B  Bytes per block     |%d  Device ID (dec)    |%D  Device ID (hex)\n%f  All mode bits (hex) |%F  File type          |%g  Group ID\n%G  Group name          |%h  Hard links         |%i  Inode\n%n  Filename            |%N  Long filename      |%o  I/O block size\n%s  Size (bytes)        |%u  User ID            |%U  User name\n%x  Access time         |%X  Access unix time   |%y  File write time\n%Y  File write unix time|%z  Dir change time    |%Z  Dir change unix time\n\nThe valid format escape sequences for filesystems:\n%a  Available blocks    |%b  Total blocks       |%c  Total inodes\n%d  Free inodes         |%f  Free blocks        |%i  File system ID\n%l  Max filename length |%n  File name          |%s  Fragment size\n%S  Best transfer size  |%t  File system type\n\n"
 
+#define help_shred "usage: shred [-fuz] [-n COUNT] [-s SIZE] FILE...\n\nSecurely delete a file by overwriting its contents with random data.\n\n-f        Force (chmod if necessary)\n-n COUNT  Random overwrite iterations (default 1)\n-o OFFSET Start at OFFSET\n-s SIZE   Use SIZE instead of detecting file size\n-u        unlink (actually delete file when done)\n-x        Use exact size (default without -s rounds up to next 4k)\n-z        zero at end\n\nNote: data journaling filesystems render this command useless, you must\noverwrite all free space (fill up disk) to erase old data on those.\n\n"
+
 #define help_setsid "usage: setsid [-t] command [args...]\n\nRun process in a new session.\n\n-t	Grab tty (become foreground process, receiving keyboard signals)\n\n"
 
 #define help_rmmod "usage: rmmod [-wf] [MODULE]\n\nUnload the module named MODULE from the Linux kernel.\n-f	Force unload of a module\n-w	Wait until the module is no longer used.\n\n\n"
diff --git a/generated/newtoys.h b/generated/newtoys.h
index 37e8e8a..ed5cba3 100644
--- a/generated/newtoys.h
+++ b/generated/newtoys.h
@@ -174,6 +174,7 @@
 USE_SETSID(NEWTOY(setsid, "^<1t", TOYFLAG_USR|TOYFLAG_BIN))
 USE_SH(NEWTOY(sh, "c:"USE_SH_INTERACTIVE("i"), TOYFLAG_BIN))
 USE_SHA1SUM(NEWTOY(sha1sum, "b", TOYFLAG_USR|TOYFLAG_BIN))
+USE_SHRED(NEWTOY(shred, "<1zxus#<1n#<1o#<0f", TOYFLAG_USR|TOYFLAG_BIN))
 USE_SKELETON(NEWTOY(skeleton, "(walrus)(blubber):;(also):e@d*c#b:a", TOYFLAG_USR|TOYFLAG_BIN))
 USE_SKELETON_ALIAS(NEWTOY(skeleton_alias, "b#dq", TOYFLAG_USR|TOYFLAG_BIN))
 USE_SLEEP(NEWTOY(sleep, "<1", TOYFLAG_BIN))
diff --git a/generated/oldtoys.h b/generated/oldtoys.h
index eb7f030..95f5512 100644
--- a/generated/oldtoys.h
+++ b/generated/oldtoys.h
@@ -125,6 +125,7 @@
 #define OPTSTR_setsid	"^<1t"
 #define OPTSTR_sh	"c:"USE_SH_INTERACTIVE("i")
 #define OPTSTR_sha1sum	"b"
+#define OPTSTR_shred	"<1zxus#<1n#<1o#<0f"
 #define OPTSTR_skeleton	"(walrus)(blubber):;(also):e@d*c#b:a"
 #define OPTSTR_skeleton_alias	"b#dq"
 #define OPTSTR_sleep	"<1"