pinosaur
/
surf.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Change site styles structure for a more generic one
[surf.git]
/
surf.c
diff --git
a/surf.c
b/surf.c
index
cdd0cc6
..
77e3d6f
100644
(file)
--- a/
surf.c
+++ b/
surf.c
@@
-136,9
+136,9
@@
typedef struct {
typedef struct {
char *regex;
typedef struct {
char *regex;
- char *
sty
le;
+ char *
fi
le;
regex_t re;
regex_t re;
-} SiteS
tyle
;
+} SiteS
pecific
;
/* Surf */
static void usage(void);
/* Surf */
static void usage(void);
@@
-246,8
+246,8
@@
char *argv0;
void
usage(void)
{
void
usage(void)
{
- die("usage: %s [-bBdDfFgGiIkKmMnNpPsSvx] [-a cookiepolicies ] "
- "[-c cookiefile] [-
e xid] [-r scriptfile] [-t style
file] "
+ die("usage: %s [-bBdDfFgGiIkKmMnNpPsS
tT
vx] [-a cookiepolicies ] "
+ "[-c cookiefile] [-
C stylefile] [-e xid] [-r script
file] "
"[-u useragent] [-z zoomlevel] [uri]\n", basename(argv0));
}
"[-u useragent] [-z zoomlevel] [uri]\n", basename(argv0));
}
@@
-304,8
+304,8
@@
setup(void)
styles[i].regex);
styles[i].regex = NULL;
}
styles[i].regex);
styles[i].regex = NULL;
}
- styles[i].
sty
le = g_strconcat(styledir, "/",
-
styles[i].sty
le, NULL);
+ styles[i].
fi
le = g_strconcat(styledir, "/",
+
styles[i].fi
le, NULL);
}
g_free(styledir);
} else {
}
g_free(styledir);
} else {
@@
-748,7
+748,7
@@
getstyle(const char *uri)
for (i = 0; i < LENGTH(styles); ++i) {
if (styles[i].regex &&
!regexec(&(styles[i].re), uri, 0, NULL, 0))
for (i = 0; i < LENGTH(styles); ++i) {
if (styles[i].regex &&
!regexec(&(styles[i].re), uri, 0, NULL, 0))
- return styles[i].
sty
le;
+ return styles[i].
fi
le;
}
return "";
}
return "";
@@
-817,7
+817,7
@@
newwindow(Client *c, const Arg *a, int noembed)
{
int i = 0;
char tmp[64];
{
int i = 0;
char tmp[64];
- const char *cmd[2
6
], *uri;
+ const char *cmd[2
8
], *uri;
const Arg arg = { .v = cmd };
cmd[i++] = argv0;
const Arg arg = { .v = cmd };
cmd[i++] = argv0;
@@
-828,6
+828,10
@@
newwindow(Client *c, const Arg *a, int noembed)
cmd[i++] = "-c";
cmd[i++] = cookiefile;
}
cmd[i++] = "-c";
cmd[i++] = cookiefile;
}
+ if (stylefile && g_strcmp0(stylefile, "")) {
+ cmd[i++] = "-C";
+ cmd[i++] = stylefile;
+ }
cmd[i++] = curconfig[DiskCache].val.b ? "-D" : "-d";
if (embed && !noembed) {
cmd[i++] = "-e";
cmd[i++] = curconfig[DiskCache].val.b ? "-D" : "-d";
if (embed && !noembed) {
cmd[i++] = "-e";
@@
-846,10
+850,7
@@
newwindow(Client *c, const Arg *a, int noembed)
cmd[i++] = scriptfile;
}
cmd[i++] = curconfig[JavaScript].val.b ? "-S" : "-s";
cmd[i++] = scriptfile;
}
cmd[i++] = curconfig[JavaScript].val.b ? "-S" : "-s";
- if (stylefile && g_strcmp0(stylefile, "")) {
- cmd[i++] = "-t";
- cmd[i++] = stylefile;
- }
+ cmd[i++] = curconfig[StrictTLS].val.b ? "-T" : "-t";
if (fulluseragent && g_strcmp0(fulluseragent, "")) {
cmd[i++] = "-u";
cmd[i++] = fulluseragent;
if (fulluseragent && g_strcmp0(fulluseragent, "")) {
cmd[i++] = "-u";
cmd[i++] = fulluseragent;
@@
-1743,6
+1744,12
@@
main(int argc, char *argv[])
case 'S':
defconfig CSETB(JavaScript, 1);
break;
case 'S':
defconfig CSETB(JavaScript, 1);
break;
+ case 't':
+ defconfig CSETB(StrictTLS, 0);
+ break;
+ case 'T':
+ defconfig CSETB(StrictTLS, 1);
+ break;
case 'u':
fulluseragent = EARGF(usage());
break;
case 'u':
fulluseragent = EARGF(usage());
break;