- /* Iff the user hasn't changed the port from the protocol
- * default (if any), update it with the new protocol's
- * default.
- * (XXX: this isn't perfect; a default can become permanent
- * by going via the serial backend. However, it helps with
- * the common case of tabbing through the controls in order
- * and setting a non-default port.) */
- if (cfg->port == ob->default_port &&
- cfg->port > 0 && nb->default_port > 0)
+ /* Iff the user hasn't changed the port from the old protocol's
+ * default, update it with the new protocol's default.
+ * (This includes a "default" of 0, implying that there is no
+ * sensible default for that protocol; in this case it's
+ * displayed as a blank.)
+ * This helps with the common case of tabbing through the
+ * controls in order and setting a non-default port before
+ * getting to the protocol; we want that non-default port
+ * to be preserved. */
+ if (cfg->port == ob->default_port)