mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-03-22 14:39:24 -05:00
Improve stop-bits messages in serial setup.
On Windows, due to a copy-paste goof, the message that should have read "Configuring n stop bits" instead ended with "data bits". While I'm here, I've arranged that the "1 stop bit" case of that message is in the singular. And then I've done the same thing again on Unix, because I noticed that message was unconditionally plural too. (cherry picked from commit bdb7b47a5ec9809c9ea2544a02c36968a714c788)
This commit is contained in:
parent
eccd4bf781
commit
b29af6df36
@ -199,8 +199,8 @@ static const char *serial_configure(Serial *serial, Conf *conf)
|
|||||||
} else {
|
} else {
|
||||||
options.c_cflag &= ~CSTOPB;
|
options.c_cflag &= ~CSTOPB;
|
||||||
}
|
}
|
||||||
logeventf(serial->logctx, "Configuring %d stop bits",
|
logeventf(serial->logctx, "Configuring %s",
|
||||||
(options.c_cflag & CSTOPB ? 2 : 1));
|
(options.c_cflag & CSTOPB ? "2 stop bits" : "1 stop bit"));
|
||||||
|
|
||||||
options.c_iflag &= ~(IXON|IXOFF);
|
options.c_iflag &= ~(IXON|IXOFF);
|
||||||
#ifdef CRTSCTS
|
#ifdef CRTSCTS
|
||||||
|
@ -131,12 +131,12 @@ static const char *serial_configure(Serial *serial, HANDLE serport, Conf *conf)
|
|||||||
logeventf(serial->logctx, "Configuring %u data bits", dcb.ByteSize);
|
logeventf(serial->logctx, "Configuring %u data bits", dcb.ByteSize);
|
||||||
|
|
||||||
switch (conf_get_int(conf, CONF_serstopbits)) {
|
switch (conf_get_int(conf, CONF_serstopbits)) {
|
||||||
case 2: dcb.StopBits = ONESTOPBIT; str = "1"; break;
|
case 2: dcb.StopBits = ONESTOPBIT; str = "1 stop bit"; break;
|
||||||
case 3: dcb.StopBits = ONE5STOPBITS; str = "1.5"; break;
|
case 3: dcb.StopBits = ONE5STOPBITS; str = "1.5 stop bits"; break;
|
||||||
case 4: dcb.StopBits = TWOSTOPBITS; str = "2"; break;
|
case 4: dcb.StopBits = TWOSTOPBITS; str = "2 stop bits"; break;
|
||||||
default: return "Invalid number of stop bits (need 1, 1.5 or 2)";
|
default: return "Invalid number of stop bits (need 1, 1.5 or 2)";
|
||||||
}
|
}
|
||||||
logeventf(serial->logctx, "Configuring %s data bits", str);
|
logeventf(serial->logctx, "Configuring %s", str);
|
||||||
|
|
||||||
switch (conf_get_int(conf, CONF_serparity)) {
|
switch (conf_get_int(conf, CONF_serparity)) {
|
||||||
case SER_PAR_NONE: dcb.Parity = NOPARITY; str = "no"; break;
|
case SER_PAR_NONE: dcb.Parity = NOPARITY; str = "no"; break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user