diff --git a/ttyverse.pl b/ttyverse.pl index 3fbb0a4..dec4051 100755 --- a/ttyverse.pl +++ b/ttyverse.pl @@ -2034,8 +2034,8 @@ if (length($credentials)) { # Update server configuration (character limits, etc.) &update_server_config; - # Check and sync profile if enabled - &check_and_sync_profile($keyfile); + # Check and sync profile if enabled (only for interactive mode) + &check_and_sync_profile($keyfile) unless (length($status)); } #### BOT/DAEMON MODE STARTUP #### @@ -10933,10 +10933,11 @@ sub cosplit { $mode += 0; $k = $orig_k; - # optimize whitespace + # optimize whitespace (but preserve intentional newlines) $k =~ s/^\s+//; $k =~ s/\s+$//; - $k =~ s/\s+/ /g; + # Only flatten whitespace if it doesn't contain intentional newlines + $k =~ s/\s+/ /g unless ($k =~ /\n/); $z = &$lengthsub($k); return ($k) if ($z <= $linelength); # also handles the trivial case