summary refs log tree commit diff
path: root/bin/xx.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--bin/xx.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/bin/xx.c b/bin/xx.c
index 1dd7ce5e..39d7ec07 100644
--- a/bin/xx.c
+++ b/bin/xx.c
@@ -34,10 +34,11 @@ static bool zero(const byte *ptr, size_t size) {
 static struct {
 	size_t cols;
 	size_t group;
+	size_t blank;
 	bool ascii;
 	bool offset;
 	bool skip;
-} options = { 16, 8, true, true, false };
+} options = { 16, 8, 0, true, true, false };
 
 static void dump(FILE *file) {
 	bool skip = false;
@@ -59,6 +60,12 @@ static void dump(FILE *file) {
 			}
 		}
 
+		if (options.blank) {
+			if (offset && offset % options.blank == 0) {
+				printf("\n");
+			}
+		}
+
 		if (options.offset) {
 			printf("%08zX:  ", offset);
 		}
@@ -106,11 +113,12 @@ int main(int argc, char *argv[]) {
 	const char *path = NULL;
 
 	int opt;
-	while (0 < (opt = getopt(argc, argv, "ac:g:rsz"))) {
+	while (0 < (opt = getopt(argc, argv, "ac:g:p:rsz"))) {
 		switch (opt) {
 			break; case 'a': options.ascii ^= true;
 			break; case 'c': options.cols = strtoul(optarg, NULL, 0);
 			break; case 'g': options.group = strtoul(optarg, NULL, 0);
+			break; case 'p': options.blank = strtoul(optarg, NULL, 0);
 			break; case 'r': reverse = true;
 			break; case 's': options.offset ^= true;
 			break; case 'z': options.skip ^= true;