*p++ = '\0';
val = p;
} else
- val = NULL;
+ val = NULL;
+
if (!strcmp(opt, "-help")) {
- help();
- nogo = TRUE;
+ if (val) {
+ errs = TRUE;
+ fprintf(stderr, "puttygen: option `-%s'"
+ " expects no argument\n", opt);
+ } else {
+ help();
+ nogo = TRUE;
+ }
} else if (!strcmp(opt, "-version")) {
- showversion();
- nogo = TRUE;
+ if (val) {
+ errs = TRUE;
+ fprintf(stderr, "puttygen: option `-%s'"
+ " expects no argument\n", opt);
+ } else {
+ showversion();
+ nogo = TRUE;
+ }
} else if (!strcmp(opt, "-pgpfp")) {
- /* support "-pgpfp" for consistency with others */
- pgp_fingerprints();
- nogo = TRUE;
+ if (val) {
+ errs = TRUE;
+ fprintf(stderr, "puttygen: option `-%s'"
+ " expects no argument\n", opt);
+ } else {
+ /* support --pgpfp for consistency */
+ pgp_fingerprints();
+ nogo = TRUE;
+ }
}
/*
- * A sample option requiring an argument:
+ * For long options requiring an argument, add
+ * code along the lines of
*
* else if (!strcmp(opt, "-output")) {
- * if (!val)
- * errs = TRUE, error(err_optnoarg, opt);
- * else
+ * if (!val) {
+ * errs = TRUE;
+ * fprintf(stderr, "puttygen: option `-%s'"
+ * " expects an argument\n", opt);
+ * } else
* ofile = val;
* }
*/
unsigned char currentEmbedding;
unsigned char currentOverride;
unsigned char tempType;
- int i, j, imax, yes, bover;
+ int i, j, yes, bover;
/* Check the presence of R or AL types as optimization */
yes = 0;
* level or higher
*/
/* we flip the character string and leave the level array */
- imax = 0;
i=0;
tempType = levels[0];
while (i < count) {
- if (levels[i] > tempType) {
+ if (levels[i] > tempType)
tempType = levels[i];
- imax=i;
- }
i++;
}
- /* maximum level in tempType, its index in imax. */
+ /* maximum level in tempType. */
while (tempType > 0) { /* loop from highest level to the least odd, */
/* which i assume is 1 */
flipThisRun(line, levels, tempType, count);
/* log the debug message */
char *msg;
int msglen;
- int always_display;
- /* XXX maybe we should actually take notice of this */
- always_display = ssh2_pkt_getbool(pktin);
+ /* XXX maybe we should actually take notice of the return value */
+ ssh2_pkt_getbool(pktin);
ssh_pkt_getstring(pktin, &msg, &msglen);
logeventf(ssh, "Remote debug message: %.*s", msglen, msg);
termchar *lchars;
int dirty_line, dirty_run, selected;
unsigned long attr = 0, cset = 0;
- int updated_line = 0;
int start = 0;
int ccount = 0;
int last_run_dirty = 0;
if (attr & (TATTR_ACTCURS | TATTR_PASCURS))
do_cursor(ctx, start, i, ch, ccount, attr,
ldata->lattr);
-
- updated_line = 1;
}
start = j;
ccount = 0;
if (attr & (TATTR_ACTCURS | TATTR_PASCURS))
do_cursor(ctx, start, i, ch, ccount, attr,
ldata->lattr);
-
- updated_line = 1;
}
unlineptr(ldata);
sprintf(cbuf, "<U+%04x>", (ldata[top.x] & 0xFFFF));
#else
wchar_t cbuf[16], *p;
- int set, c;
+ int c;
int x = top.x;
if (ldata->chars[x].chr == UCSWIDE) {
break;
}
- set = (uc & CSET_MASK);
c = (uc & ~CSET_MASK);
#ifdef PLATFORM_IS_UTF16
if (uc > 0x10000 && uc < 0x110000) {
inst->menu = gtk_menu_new();
-#define MKMENUITEM(title, func) do { \
- menuitem = title ? gtk_menu_item_new_with_label(title) : \
- gtk_menu_item_new(); \
- gtk_container_add(GTK_CONTAINER(inst->menu), menuitem); \
- gtk_widget_show(menuitem); \
- if (func != NULL) \
- gtk_signal_connect(GTK_OBJECT(menuitem), "activate", \
- GTK_SIGNAL_FUNC(func), inst); \
-} while (0)
+#define MKMENUITEM(title, func) do \
+ { \
+ menuitem = gtk_menu_item_new_with_label(title); \
+ gtk_container_add(GTK_CONTAINER(inst->menu), menuitem); \
+ gtk_widget_show(menuitem); \
+ gtk_signal_connect(GTK_OBJECT(menuitem), "activate", \
+ GTK_SIGNAL_FUNC(func), inst); \
+ } while (0)
+
+#define MKSUBMENU(title) do \
+ { \
+ menuitem = gtk_menu_item_new_with_label(title); \
+ gtk_container_add(GTK_CONTAINER(inst->menu), menuitem); \
+ gtk_widget_show(menuitem); \
+ } while (0)
+
+#define MKSEP() do \
+ { \
+ menuitem = gtk_menu_item_new(); \
+ gtk_container_add(GTK_CONTAINER(inst->menu), menuitem); \
+ gtk_widget_show(menuitem); \
+ } while (0)
+
if (new_session)
MKMENUITEM("New Session...", new_session_menuitem);
MKMENUITEM("Restart Session", restart_session_menuitem);
gtk_menu_item_set_submenu(GTK_MENU_ITEM(menuitem),
inst->sessionsmenu);
}
- MKMENUITEM(NULL, NULL);
+ MKSEP();
MKMENUITEM("Change Settings...", change_settings_menuitem);
- MKMENUITEM(NULL, NULL);
+ MKSEP();
if (use_event_log)
MKMENUITEM("Event Log", event_log_menuitem);
- MKMENUITEM("Special Commands", NULL);
+ MKSUBMENU("Special Commands");
inst->specialsmenu = gtk_menu_new();
gtk_menu_item_set_submenu(GTK_MENU_ITEM(menuitem), inst->specialsmenu);
inst->specialsitem1 = menuitem;
- MKMENUITEM(NULL, NULL);
+ MKSEP();
inst->specialsitem2 = menuitem;
gtk_widget_hide(inst->specialsitem1);
gtk_widget_hide(inst->specialsitem2);
MKMENUITEM("Clear Scrollback", clear_scrollback_menuitem);
MKMENUITEM("Reset Terminal", reset_terminal_menuitem);
MKMENUITEM("Copy All", copy_all_menuitem);
- MKMENUITEM(NULL, NULL);
+ MKSEP();
s = dupcat("About ", appname, NULL);
MKMENUITEM(s, about_menuitem);
sfree(s);
#undef MKMENUITEM
+#undef MKSUBMENU
+#undef MKSEP
}
inst->textcursor = make_mouse_ptr(inst, GDK_XTERM);
int errors;
int use_subsystem = 0;
int got_host = FALSE;
- void *ldisc;
long now;
fdlist = NULL;
return 1;
}
back->provide_logctx(backhandle, logctx);
- ldisc = ldisc_create(&cfg, NULL, back, backhandle, NULL);
+ ldisc_create(&cfg, NULL, back, backhandle, NULL);
sfree(realhost);
}
connopen = 1;
static void serial_reconfig(void *handle, Config *cfg)
{
Serial serial = (Serial) handle;
- const char *err;
-
- err = serial_configure(serial, cfg);
/*
- * FIXME: what should we do if err returns something?
+ * FIXME: what should we do if this returns an error?
*/
+ serial_configure(serial, cfg);
}
static int serial_select_result(int fd, int event)