summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Jennings <mej@kainx.org>2002-11-27 20:18:24 +0000
committerMichael Jennings <mej@kainx.org>2002-11-27 20:18:24 +0000
commit675bf268aa21610190446608658e051c4a725a67 (patch)
treebf2154e9256bb5e2655eb5438a8e66f6eff55374
parent28dcf3270851c50f8351a2b9cc6b8dc227b253fb (diff)
downloadeterm-675bf268aa21610190446608658e051c4a725a67.tar.gz
Wed Nov 27 15:17:04 2002 Michael Jennings (mej)
Same as yesterday, only this time I'm *actually* going to fix the problem. >:I I should really read more carefully. While I was at it, I fixed some bad uses of BEG_STRCASECMP(). SVN revision: 6467
-rw-r--r--ChangeLog7
-rw-r--r--src/command.c15
-rw-r--r--src/options.c10
-rw-r--r--src/pixmap.c10
-rw-r--r--src/term.c24
5 files changed, 37 insertions, 29 deletions
diff --git a/ChangeLog b/ChangeLog
index e1e4928..0f2b04d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -4939,3 +4939,10 @@ Tue Nov 26 17:51:34 2002 Michael Jennings (mej)
I need my Escreen sessions to be able to beep, so let's allow that.
----------------------------------------------------------------------
+Wed Nov 27 15:17:04 2002 Michael Jennings (mej)
+
+Same as yesterday, only this time I'm *actually* going to fix the
+problem. >:I I should really read more carefully.
+
+While I was at it, I fixed some bad uses of BEG_STRCASECMP().
+----------------------------------------------------------------------
diff --git a/src/command.c b/src/command.c
index 48b4df8..988237e 100644
--- a/src/command.c
+++ b/src/command.c
@@ -2518,7 +2518,7 @@ err_msg(void *xd, int err, char *msg)
{
#if DEBUG >= DEBUG_ESCREEN
if (DEBUG_LEVEL >= DEBUG_ESCREEN) {
- char *sc[] = { "Copy mode", "Bell in", "Wuff" };
+ char *sc[] = { "Copy mode", "Bell in" };
int n, nsc = sizeof(sc) / sizeof(char *);
/* there are certain things that would make sense if we were displaying
@@ -2527,10 +2527,6 @@ err_msg(void *xd, int err, char *msg)
if (strlen(msg)) {
for (n = 0; n < nsc; n++) {
if (!strncmp(msg, sc[n], strlen(sc[n]))) {
- if (n == 2) {
- /* Beep */
- scr_bell();
- }
break;
}
}
@@ -2538,11 +2534,16 @@ err_msg(void *xd, int err, char *msg)
menu_dialog(NULL, msg, 0, NULL, NULL);
}
}
- }
+ } else
#endif
+
+ if (!BEG_STRCASECMP(msg, "Wuff")) {
+ /* screen beeped, so go ahead and use our normal beep. */
+ scr_bell();
+ }
+
USE_VAR(xd);
USE_VAR(err);
- USE_VAR(msg);
return NS_SUCC;
}
diff --git a/src/options.c b/src/options.c
index e03261c..c19eebe 100644
--- a/src/options.c
+++ b/src/options.c
@@ -1617,15 +1617,15 @@ parse_image(char *buff, void *state)
char *allow;
for (; (allow = (char *) strsep(&allow_list, " ")) != NULL;) {
- if (!BEG_STRCASECMP("image", allow)) {
+ if (!BEG_STRCASECMP(allow, "image")) {
images[idx].mode |= ALLOW_IMAGE;
- } else if (!BEG_STRCASECMP("transparent", allow)) {
+ } else if (!BEG_STRCASECMP(allow, "trans")) {
images[idx].mode |= ALLOW_TRANS;
- } else if (!BEG_STRCASECMP("viewport", allow)) {
+ } else if (!BEG_STRCASECMP(allow, "viewport")) {
images[idx].mode |= ALLOW_VIEWPORT;
- } else if (!BEG_STRCASECMP("auto", allow)) {
+ } else if (!BEG_STRCASECMP(allow, "auto")) {
images[idx].mode |= ALLOW_AUTO;
- } else if (!BEG_STRCASECMP("solid", allow)) {
+ } else if (!BEG_STRCASECMP(allow, "solid")) {
} else {
print_error("Parse error in file %s, line %lu: Invalid mode \"%s\"\n", file_peek_path(), file_peek_line(), allow);
}
diff --git a/src/pixmap.c b/src/pixmap.c
index 147a590..cf89eb2 100644
--- a/src/pixmap.c
+++ b/src/pixmap.c
@@ -222,15 +222,15 @@ parse_pixmap_ops(char *str)
D_PIXMAP(("parse_pixmap_ops(str [%s]) called.\n", str));
for (; (token = (char *) strsep(&str, ":"));) {
- if (!BEG_STRCASECMP("tiled", token)) {
+ if (!BEG_STRCASECMP(token, "tile")) {
op |= OP_TILE;
- } else if (!BEG_STRCASECMP("hscaled", token)) {
+ } else if (!BEG_STRCASECMP(token, "hscale")) {
op |= OP_HSCALE;
- } else if (!BEG_STRCASECMP("vscaled", token)) {
+ } else if (!BEG_STRCASECMP(token, "vscale")) {
op |= OP_VSCALE;
- } else if (!BEG_STRCASECMP("scaled", token)) {
+ } else if (!BEG_STRCASECMP(token, "scale")) {
op |= OP_SCALE;
- } else if (!BEG_STRCASECMP("propscaled", token)) {
+ } else if (!BEG_STRCASECMP(token, "propscale")) {
op |= OP_PROPSCALE;
}
}
diff --git a/src/term.c b/src/term.c
index 1ab5561..869e038 100644
--- a/src/term.c
+++ b/src/term.c
@@ -1978,11 +1978,11 @@ xterm_seq(int op, const char *str)
if (iml->mod == NULL) {
iml->mod = create_colormod();
}
- if (!BEG_STRCASECMP("brightness", mod)) {
+ if (!BEG_STRCASECMP(mod, "brightness")) {
iml->mod->brightness = (int) strtol(valptr, (char **) NULL, 0);
- } else if (!BEG_STRCASECMP("contrast", mod)) {
+ } else if (!BEG_STRCASECMP(mod, "contrast")) {
iml->mod->contrast = (int) strtol(valptr, (char **) NULL, 0);
- } else if (!BEG_STRCASECMP("gamma", mod)) {
+ } else if (!BEG_STRCASECMP(mod, "gamma")) {
iml->mod->gamma = (int) strtol(valptr, (char **) NULL, 0);
}
update_cmod(iml->mod);
@@ -1995,11 +1995,11 @@ xterm_seq(int op, const char *str)
if (iml->rmod == NULL) {
iml->rmod = create_colormod();
}
- if (!BEG_STRCASECMP("brightness", mod)) {
+ if (!BEG_STRCASECMP(mod, "brightness")) {
iml->rmod->brightness = (int) strtol(valptr, (char **) NULL, 0);
- } else if (!BEG_STRCASECMP("contrast", mod)) {
+ } else if (!BEG_STRCASECMP(mod, "contrast")) {
iml->rmod->contrast = (int) strtol(valptr, (char **) NULL, 0);
- } else if (!BEG_STRCASECMP("gamma", mod)) {
+ } else if (!BEG_STRCASECMP(mod, "gamma")) {
iml->rmod->gamma = (int) strtol(valptr, (char **) NULL, 0);
}
update_cmod(iml->rmod);
@@ -2012,11 +2012,11 @@ xterm_seq(int op, const char *str)
if (iml->gmod == NULL) {
iml->gmod = create_colormod();
}
- if (!BEG_STRCASECMP("brightness", mod)) {
+ if (!BEG_STRCASECMP(mod, "brightness")) {
iml->gmod->brightness = (int) strtol(valptr, (char **) NULL, 0);
- } else if (!BEG_STRCASECMP("contrast", mod)) {
+ } else if (!BEG_STRCASECMP(mod, "contrast")) {
iml->gmod->contrast = (int) strtol(valptr, (char **) NULL, 0);
- } else if (!BEG_STRCASECMP("gamma", mod)) {
+ } else if (!BEG_STRCASECMP(mod, "gamma")) {
iml->gmod->gamma = (int) strtol(valptr, (char **) NULL, 0);
}
update_cmod(iml->gmod);
@@ -2029,11 +2029,11 @@ xterm_seq(int op, const char *str)
if (iml->bmod == NULL) {
iml->bmod = create_colormod();
}
- if (!BEG_STRCASECMP("brightness", mod)) {
+ if (!BEG_STRCASECMP(mod, "bright")) {
iml->bmod->brightness = (int) strtol(valptr, (char **) NULL, 0);
- } else if (!BEG_STRCASECMP("contrast", mod)) {
+ } else if (!BEG_STRCASECMP(mod, "contrast")) {
iml->bmod->contrast = (int) strtol(valptr, (char **) NULL, 0);
- } else if (!BEG_STRCASECMP("gamma", mod)) {
+ } else if (!BEG_STRCASECMP(mod, "gamma")) {
iml->bmod->gamma = (int) strtol(valptr, (char **) NULL, 0);
}
update_cmod(iml->bmod);