Hello community, here is the log from the commit of package no-more-secrets for openSUSE:Factory checked in at 2018-01-09 14:54:49 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/no-more-secrets (Old) and /work/SRC/openSUSE:Factory/.no-more-secrets.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "no-more-secrets" Tue Jan 9 14:54:49 2018 rev:3 rq:562451 version:0.3.3 Changes: -------- --- /work/SRC/openSUSE:Factory/no-more-secrets/no-more-secrets.changes 2017-03-24 02:09:18.480883202 +0100 +++ /work/SRC/openSUSE:Factory/.no-more-secrets.new/no-more-secrets.changes 2018-01-09 14:54:52.003094978 +0100 @@ -1,0 +2,7 @@ +Mon Jan 8 09:55:54 UTC 2018 - [email protected] + +- Update to 0.3.3 + * Option to mask space characters (-s) + * Minor bug fixes + +------------------------------------------------------------------- Old: ---- no-more-secrets-0.3.2.tar.gz New: ---- no-more-secrets-0.3.3.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ no-more-secrets.spec ++++++ --- /var/tmp/diff_new_pack.zKPJCy/_old 2018-01-09 14:54:52.583067790 +0100 +++ /var/tmp/diff_new_pack.zKPJCy/_new 2018-01-09 14:54:52.587067602 +0100 @@ -1,7 +1,7 @@ # # spec file for package no-more-secrets # -# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,7 +17,7 @@ Name: no-more-secrets -Version: 0.3.2 +Version: 0.3.3 Release: 0 Summary: A recreation of the "decrypting text" effect from the 1992 movie Sneakers License: GPL-3.0+ ++++++ no-more-secrets-0.3.2.tar.gz -> no-more-secrets-0.3.3.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/no-more-secrets-0.3.2/README.md new/no-more-secrets-0.3.3/README.md --- old/no-more-secrets-0.3.2/README.md 2017-02-19 19:29:28.000000000 +0100 +++ new/no-more-secrets-0.3.3/README.md 2017-09-20 15:15:04.000000000 +0200 @@ -1,4 +1,4 @@ - + No More Secrets =============== @@ -33,6 +33,7 @@ 2. [Usage](#usage) 3. [The NMS Library](#the-nms-library) 4. [License](#license) +5. [Tips](#tips) Download and Install -------------------- @@ -51,11 +52,11 @@ #### Install: ``` -git clone https://github.com/bartobri/no-more-secrets.git -cd ./no-more-secrets -make nms -make sneakers ## Optional -sudo make install +$ git clone https://github.com/bartobri/no-more-secrets.git +$ cd ./no-more-secrets +$ make nms +$ make sneakers ## Optional +$ sudo make install ``` #### Uninstall: @@ -72,11 +73,11 @@ library from your package manager](NCURSES.md). Next, follow these instructions: ``` -git clone https://github.com/bartobri/no-more-secrets.git -cd ./no-more-secrets -make nms-ncurses -make sneakers-ncurses ## Optional -sudo make install +$ git clone https://github.com/bartobri/no-more-secrets.git +$ cd ./no-more-secrets +$ make nms-ncurses +$ make sneakers-ncurses ## Optional +$ sudo make install ``` Usage @@ -86,11 +87,12 @@ enjoy the magic. In the below examples, I use a simple directory listing. ``` -ls -l | nms -ls -l | nms -a // Set auto-decrypt flag -ls -l | nms -f green // Set foreground color to green -ls -l | nms -c // Clear screen -nms -v // Display version +$ ls -l | nms +$ ls -l | nms -a // Set auto-decrypt flag +$ ls -l | nms -s // Set flag to mask space characters +$ ls -l | nms -f green // Set foreground color to green +$ ls -l | nms -c // Clear screen +$ nms -v // Display version ``` Note that by default, after the initial encrypted characters are displayed, @@ -104,6 +106,11 @@ Set the auto-decrypt flag. This will automatically start the decryption sequence without requiring a key press. +`-s` + +Set a flag to mask space characters. This will only mask single blank space +characters. Other space characters such as tabs and newlines will not be masked. + `-f <color>` Set the foreground color of the decrypted text to the color @@ -134,5 +141,10 @@ ------- This program is free software; you can redistribute it and/or modify it -under the terms of the the MIT License (MIT). See [LICENSE](LICENSE) for +under the terms of the GNU General Public License. See [LICENSE](LICENSE) for more details. + +Tips +---- + +[Tips are always appreciated!](https://github.com/bartobri/tips) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/no-more-secrets-0.3.2/nms.6 new/no-more-secrets-0.3.3/nms.6 --- old/no-more-secrets-0.3.2/nms.6 2017-02-19 19:29:28.000000000 +0100 +++ new/no-more-secrets-0.3.3/nms.6 2017-09-20 15:15:04.000000000 +0200 @@ -11,6 +11,9 @@ .B -a sets the auto-decrypt flag, decryption sequence starts without requiring a key press. .TP +.B -s +sets the mask blanks flag. Blank spaces will be encrypted and decrypted. +.TP .B -c clear the screen prior to printing any output .TP diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/no-more-secrets-0.3.2/src/nms.c new/no-more-secrets-0.3.3/src/nms.c --- old/no-more-secrets-0.3.2/src/nms.c 2017-02-19 19:29:28.000000000 +0100 +++ new/no-more-secrets-0.3.3/src/nms.c 2017-09-20 15:15:04.000000000 +0200 @@ -11,15 +11,16 @@ #include <ctype.h> #include "nmseffect.h" -#define VERSION "0.3.2" +#define VERSION "0.3.3" +#define INITIAL_CAPACITY 50 #define INPUT_GROWTH_FACTOR 2 int main(int argc, char *argv[]) { - int c, o, inSize = 0, inCapacity = 0; + int c, o, i, inCapacity = INITIAL_CAPACITY; char *input = NULL; // Processing command arguments - while ((o = getopt(argc, argv, "f:acv")) != -1) { + while ((o = getopt(argc, argv, "f:ascv")) != -1) { switch (o) { case 'f': nmseffect_set_foregroundcolor(optarg); @@ -27,6 +28,9 @@ case 'a': nmseffect_set_autodecrypt(1); break; + case 's': + nmseffect_set_maskblank(1); + break; case 'c': nmseffect_set_clearscr(1); break; @@ -41,16 +45,25 @@ return 1; } } + + // Allocate memory for our input buffer + if ((input = malloc(inCapacity + 1)) == NULL) { + fprintf (stderr, "Memory Allocation Error! Quitting...\n"); + return 1; + } // Geting input - while ((c = getchar()) != EOF) { - ++inSize; - if (inSize > inCapacity) { - inCapacity = inCapacity == 0 ? INPUT_GROWTH_FACTOR : inCapacity * INPUT_GROWTH_FACTOR; + for (i = 0; (c = getchar()) != EOF; ++i) { + if (i >= inCapacity) { + inCapacity *= INPUT_GROWTH_FACTOR; input = realloc(input, inCapacity + 1); + if (input == NULL) { + fprintf (stderr, "Memory Allocation Error! Quitting...\n"); + return 1; + } } - input[inSize - 1] = c; - input[inSize] = '\0'; + input[i] = c; + input[i+1] = '\0'; } // Execute effect diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/no-more-secrets-0.3.2/src/nmseffect.c new/no-more-secrets-0.3.3/src/nmseffect.c --- old/no-more-secrets-0.3.2/src/nmseffect.c 2017-02-19 19:29:28.000000000 +0100 +++ new/no-more-secrets-0.3.3/src/nmseffect.c 2017-09-20 15:15:04.000000000 +0200 @@ -34,6 +34,7 @@ // Behavior settings static char *returnOpts = NULL; // Return option setting static int autoDecrypt = 0; // Auto-decrypt flag +static int maskBlank = 0; // Mask blank spaces static int colorOn = 1; // Terminal color flag static int inputPositionX = -1; // X coordinate for input position static int inputPositionY = -1; // Y coordinate for input position @@ -91,7 +92,10 @@ origRow = nmstermio_get_cursor_row(); // nmstermio_get_cursor_row() may display output in some terminals. So - // we need to reposition the cursor to the start of the row. + // we need to reposition the cursor to the start of the row, print + // some blank spaces, and the reposition again. + nmstermio_move_cursor(origRow, 0); + nmstermio_print_string(" "); nmstermio_move_cursor(origRow, 0); } @@ -133,10 +137,18 @@ } // Set flag if we have a whitespace character - if (strlen(list_pointer->source) == 1 && isspace(list_pointer->source[0])) - list_pointer->is_space = 1; - else + if (strlen(list_pointer->source) == 1 && isspace(list_pointer->source[0])) { + + // If flag is enabled, mask blank spaces as well + if (maskBlank && (list_pointer->source[0] == ' ')) { + list_pointer->is_space = 0; + } else { + list_pointer->is_space = 1; + } + + } else { list_pointer->is_space = 0; + } // Set initial mask chharacter list_pointer->mask = nmscharset_get_random(); @@ -347,6 +359,18 @@ } /* + * Set the maskBlank flag according to the true/false value of the + * 'setting' argument. When set to true, blank spaces characters + * will be masked as well. + */ +void nmseffect_set_maskblank(int setting) { + if (setting) + maskBlank = 1; + else + maskBlank = 0; +} + +/* * Pass the 'setting' argument to the nmstermio module where it will set * the clearScr flag according to the true/false value. When set to true, * nmseffect_exec() will clear the screen before displaying any characters. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/no-more-secrets-0.3.2/src/nmseffect.h new/no-more-secrets-0.3.3/src/nmseffect.h --- old/no-more-secrets-0.3.2/src/nmseffect.h 2017-02-19 19:29:28.000000000 +0100 +++ new/no-more-secrets-0.3.3/src/nmseffect.h 2017-09-20 15:15:04.000000000 +0200 @@ -13,6 +13,7 @@ void nmseffect_set_foregroundcolor(char *); void nmseffect_set_returnopts(char *); void nmseffect_set_autodecrypt(int); +void nmseffect_set_maskblank(int); void nmseffect_set_clearscr(int); void nmseffect_use_color(int); void nmseffect_set_input_position(int, int); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/no-more-secrets-0.3.2/src/nmstermio.c new/no-more-secrets-0.3.3/src/nmstermio.c --- old/no-more-secrets-0.3.2/src/nmstermio.c 2017-02-19 19:29:28.000000000 +0100 +++ new/no-more-secrets-0.3.3/src/nmstermio.c 2017-09-20 15:15:04.000000000 +0200 @@ -18,6 +18,11 @@ #include <unistd.h> #include <sys/ioctl.h> +// Support for MinGW on Windows +#ifndef FIONREAD +#include <sys/socket.h> +#endif + // Macros for VT100 codes #define CLEAR_SCR() printf("\033[2J") // Clear Screen #define CURSOR_HOME() printf("\033[H") // Move cursor to home position (0,0) @@ -154,7 +159,7 @@ char nmstermio_get_char(void) { struct timespec ts; int t = 50; - char c; + int c; ts.tv_sec = t / 1000; ts.tv_nsec = (t % 1000) * 1000000; @@ -163,7 +168,7 @@ nanosleep(&ts, NULL); } - return c; + return (char)c; } /*
