diff options
author | Daniel Jones <admin@danieljon.es> | 2019-03-15 10:46:35 +1030 |
---|---|---|
committer | Daniel Jones <admin@danieljon.es> | 2019-03-15 10:46:35 +1030 |
commit | 1f398be82ffdfce90b6dbbfa4ecfb87894b8064b (patch) | |
tree | e523845925d68a947658dba0363dc1ef297346e2 | |
parent | c8f409de751a8a9b8e7d33c81c86faf70a542b5f (diff) | |
download | urlopener-1f398be82ffdfce90b6dbbfa4ecfb87894b8064b.tar.gz urlopener-1f398be82ffdfce90b6dbbfa4ecfb87894b8064b.zip |
added some more domains, debug prints when NOFORK
-rw-r--r-- | urlopen.c | 16 |
1 files changed, 12 insertions, 4 deletions
@@ -53,7 +53,12 @@ char *forceddomains[][2] = {"youtu.be", "2"}, {"streamable.com", "2"}, {"www.streamable.com", "2"}, - {"files.slack.com", "4"} + {"files.slack.com", "4"}, + {"reddit.com", "4"}, + {"www.reddit.com", "4"}, + {"mod.reddit.com", "4"}, + {"redd.it", "4"} + }; int @@ -161,7 +166,8 @@ checkforceddomains(char *url, int ext) strncpy(buff, forceddomains[i][0], BUFF_SIZE-1); if (strcmp(buff, buff2) == 0) { - //printf("domain should be forced as %s\n", buff); + if (NOFORK) + printf("domain should be forced as %s\n", buff); ret = atoi(forceddomains[i][1]); goto exitdomaincheck; } @@ -187,13 +193,15 @@ main(int argc, char *argv[]) * fork, execute */ link = islink(argv[i]); - //printf("%s is probably %s link\n", argv[i], (link == 1) ? "a" : "not a"); + if (NOFORK) + printf("%s is probably %s link\n", argv[i], (link == 1) ? "a" : "not a"); if (link == 1) { ext = getext(argv[i]); // check if the domain should be forced to a program ext = checkforceddomains(argv[i], ext); - //printf("program to run is: \"%s %s\"\n", programs[ext][1], argv[i]); + if (NOFORK) + printf("program to run is: \"%s %s\"\n", programs[ext][1], argv[i]); if (NOFORK == 0) { pid_t pid = fork(); |