pmaillot / X32-Behringer

This GIT repo (C language) holds applications and utilities for the Behringer X32 and M32 mixing consoles. Additional details, documentation, implementation examples and apps can be found in my website:
https://sites.google.com/site/patrickmaillot/x32
234 stars 41 forks source link

Fix space after quoted string in X32_cparse.c #10

Closed Rippert closed 6 years ago

Rippert commented 6 years ago

Patrick - I was having trouble entering multiple values after a string in XAir_Command: /ch/01/config ->X, 16 B: /ch/01/config~~~ X->, 48 B: /ch/01/config~~~,siii~~~The blah~~~~[ 1][ 0][ 0] /ch/01/config ,siii "The blah" 1 0 0 ->X, 48 B: /ch/01/config~~~,siii~~~The blah~~~~[ 1][ 1][ 0] X->, 20 B: /ch/01/config~~~,~~~ /ch/01/config ,siii "The blah"1 0 0 ->X, 48 B: /ch/01/config~~~,siii~~~The blah~~~~[ 1][ 0][ 0] A space after a quoted string caused a repetitive misplacement of the next value. This also happened if I put multiple spaces after an unquoted string. The change to X32_parse.c fixes this. I've tried it in XAir_Command. You might want to check in X32_Command.

pmaillot commented 6 years ago

Thanks Ted for your analysis and proposed changes. I will take a look, and may propose different implementation as this program I wrote at the very beginning of my C developments for X32 tools hasn’t been optimized at all; it just worked as it was and to the (small) extent of my tests.

I’ll keep you posted.

PS: I just uploaded a modification to X32_cparse.c you may want to look at the changes which I believe make the file more consistent and provides a better handling of the different cases for string, int and float.

-Patrick-Gilles Maillot

From: Rippert [mailto:notifications@github.com] Sent: Wednesday, January 17, 2018 8:59 AM To: pmaillot/X32-Behringer X32-Behringer@noreply.github.com Cc: Subscribed subscribed@noreply.github.com Subject: Re: [pmaillot/X32-Behringer] Fix space after quoted string in X32_cparse.c (#10)

@Rippert commented on this pull request.


In X32_cparse.c https://github.com/pmaillot/X32-Behringer/pull/10#discussion_r161977263 :

                 } else {

while(k < input_len) { if (input_line[k] == SPACE) { input_line[k] = 0;

  • break;
  • if (input_line[k+1] != SPACE) break;

Account for multiple spaces after unquoted string

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/pmaillot/X32-Behringer/pull/10#pullrequestreview-89352680 , or mute the thread https://github.com/notifications/unsubscribe-auth/APOZ_sGVZ-k_MRV5cmhqrH2vI5iXX96Fks5tLag-gaJpZM4Rg7xW . https://github.com/notifications/beacon/APOZ_oIp9ek0jgBsULALTtz4AzmxzncJks5tLag-gaJpZM4Rg7xW.gif

pmaillot commented 6 years ago

I just uploaded a modification to X32_cparse.c you may want to look at the changes which I believe make the file more consistent and provides a better handling of the different cases for string, int and float. -P

Rippert commented 6 years ago

Thanks, works well and much prettier. Plus, gave me some git practice.