Skip to content
This repository has been archived by the owner on Nov 29, 2022. It is now read-only.

Commit

Permalink
Merge pull request #47 from hSaria/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
hSaria authored Jun 7, 2018
2 parents 0a851ba + 601c0c2 commit 0a8425b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
3 changes: 2 additions & 1 deletion src/defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include "config.h"

#include <ctype.h>
#include <signal.h>
#include <stdio.h>
#include <string.h>
#include <sys/stat.h>
Expand Down Expand Up @@ -37,7 +38,7 @@ typedef const char *PCRE_ERR_P;
{ compiled = pcre_compile(regex, 0, err_p, err_n, NULL); }
#endif

#define VERSION "0.2.3"
#define VERSION "0.2.4"

#define FALSE 0
#define TRUE 1
Expand Down
16 changes: 9 additions & 7 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,9 @@ int main(int argc, char **argv) {
default:
printf("ChromaTerm-- v%s\n", VERSION);
printf("Usage: %s [-a] [-c file] [-d]\n", argv[0]);
printf("%6s %-18s Allow colliding actions\n", "-a", "");
printf("%6s %-18s Override configuration file\n", "-c", "{config file}");
printf("%6s %-18s Demonstrate the available color-codes for custom "
"actions\n",
"-d", "");
printf("%7s %-5s Allow colliding actions\n", "-a", "");
printf("%7s %-5s Override configuration file\n", "-c", "file");
printf("%7s %-5s Demo the available custom color-codes\n", "-d", "");

quit_with_signal(2);
}
Expand All @@ -55,6 +53,8 @@ int main(int argc, char **argv) {
}
}

signal(SIGINT, SIG_IGN); /* Ignore interrupt */

/* fd_set used for checking if there's more input */
FD_ZERO(&readfds); /* Initialize */
FD_SET(STDIN_FILENO, &readfds);
Expand Down Expand Up @@ -162,9 +162,11 @@ void colordemo(void) {
}

void quit_with_signal(int exit_signal) {
int i;

/* Free memory used by highlights */
while (gd.highlights[0]) {
unhighlight(gd.highlights[0]->condition);
for (i = gd.highlights_used - 1; i > -1; i--) {
unhighlight(gd.highlights[i]->condition);
}

free(gd.highlights);
Expand Down

0 comments on commit 0a8425b

Please sign in to comment.