Fixing spelling spaces

Samuel Thibault samuel.thibault at ens-lyon.org
Sun Mar 19 21:01:36 EDT 2017


Zahari Yurukov, on lun. 20 mars 2017 00:19:05 +0200, wrote:
>   Samuel Thibault wrote:
> Sun, Mar 19, 2017 at 10:28:27PM +0100
> 
> > Ok, I believe the attached patch should fix all of them by grouping the
> > writes into just one go?
> > 
> Unfortunately it didn't. I get spaces just by pressing a capital letter, i. e. Shift+letter.
> If i cursor over a capital letter in vim - I get spaces, too.

Oops, sorry, it seems I tested it wrongly, here is a proper fix.

Samuel
-------------- next part --------------
Index: linux-4.10/drivers/staging/speakup/main.c
===================================================================
--- linux-4.10.orig/drivers/staging/speakup/main.c
+++ linux-4.10/drivers/staging/speakup/main.c
@@ -448,20 +448,17 @@ static void speak_char(u16 ch)
 		pr_info("speak_char: cp == NULL!\n");
 		return;
 	}
-	synth_buffer_add(SPACE);
 	if (IS_CHAR(ch, B_CAP)) {
 		spk_pitch_shift++;
-		synth_printf("%s", spk_str_caps_start);
-		synth_printf("%s", cp);
-		synth_printf("%s", spk_str_caps_stop);
+		synth_printf("%s %s %s",
+			spk_str_caps_start, cp, spk_str_caps_stop);
 	} else {
 		if (*cp == '^') {
-			synth_printf("%s", spk_msg_get(MSG_CTRL));
 			cp++;
-		}
-		synth_printf("%s", cp);
+			synth_printf(" %s%s ", spk_msg_get(MSG_CTRL), cp);
+		} else
+			synth_printf(" %s ", cp);
 	}
-	synth_buffer_add(SPACE);
 }
 
 static u16 get_char(struct vc_data *vc, u16 *pos, u_char *attribs)


More information about the Speakup mailing list