aplat

Documents structurés pour Unix
git clone git://git.asteride.xyz/~ldp/aplat.git
Journaux | Fichiers | Références | LISEZ-MOI | LICENCE

commit 6f993fdfac0fb7686cbf5ba164dcba67f8c2b61c
parent 9674eb561f89dca6562507c91defa679006d921d
Auteur: Selve <selve@asteride.xyz>
Date:   Sat, 25 Nov 2023 16:11:42 -0500

correction d'une erreur qui affectait les blocs

Un point d'exclamation était affiché lorsque les guillemets étaient échappés.

Diffstat:
Maplat.c | 14++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/aplat.c b/aplat.c @@ -333,15 +333,17 @@ bloc(FILE *f, struct tampon *tp) continue; case '"': /* compter le nombre de guillemets */ - for (npar = 1; (c = getc(f)) == '"'; npar++) + for (npar = 1; (c = getc(f)) == '"' && npar < NGUI; + npar++) ; - if (npar > NGUI || (npar == NGUI && c != '!')) { + if (c != '!' || npar < NGUI) ungetc(c, f); - tp_bloc_rec(tp); - return c; + if (npar == NGUI) { + if (c != '!') { + tp_bloc_rec(tp); + return c; + } } - if (npar != NGUI) - ungetc(c, f); while (npar-- > 0) tp_ecr('"', tp); continue;