Skip to content

Commit 7b042d3

Browse files
committed
Use isspace_c() et al in annot-tsv.c
1 parent 96af274 commit 7b042d3

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,7 @@ htsfile: htsfile.o libhts.a
526526
tabix: tabix.o libhts.a
527527
$(CC) $(LDFLAGS) -o $@ tabix.o libhts.a $(LIBS) -lpthread
528528

529-
annot-tsv.o: annot-tsv.c config.h $(htslib_hts_h) $(htslib_hts_defs_h) $(htslib_khash_str2int_h) $(htslib_kstring_h) $(htslib_kseq_h) $(htslib_bgzf_h) $(htslib_regidx_h)
529+
annot-tsv.o: annot-tsv.c config.h $(htslib_hts_h) $(htslib_hts_defs_h) $(htslib_khash_str2int_h) $(htslib_kstring_h) $(htslib_kseq_h) $(htslib_bgzf_h) $(htslib_regidx_h) $(textutils_internal_h)
530530
bgzip.o: bgzip.c config.h $(htslib_bgzf_h) $(htslib_hts_h) $(htslib_hfile_h)
531531
htsfile.o: htsfile.c config.h $(htslib_hfile_h) $(htslib_hts_h) $(htslib_sam_h) $(htslib_vcf_h)
532532
tabix.o: tabix.c config.h $(htslib_tbx_h) $(htslib_sam_h) $(htslib_vcf_h) $(htslib_kseq_h) $(htslib_bgzf_h) $(htslib_hts_h) $(htslib_regidx_h) $(htslib_hts_defs_h) $(htslib_hts_log_h) $(htslib_thread_pool_h)

annot-tsv.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
#include "htslib/kseq.h"
4545
#include "htslib/bgzf.h"
4646
#include "htslib/regidx.h"
47+
#include "textutils_internal.h"
4748

4849
#define ANN_NBP 1
4950
#define ANN_FRAC 2
@@ -409,15 +410,15 @@ void parse_header(dat_t *dat, char *fname, int nth_row, int autodetect)
409410
for (i=0; i<cols->n; i++)
410411
{
411412
char *ss = cols->off[i];
412-
while ( *ss && (*ss=='#' || isspace(*ss)) ) ss++;
413+
while ( *ss && (*ss=='#' || isspace_c(*ss)) ) ss++;
413414
if ( !*ss ) error("Could not parse the header field \"%s\": %s\n", cols->off[i],dat->line.s);
414415
if ( *ss=='[' )
415416
{
416417
char *se = ss+1;
417-
while ( *se && isdigit(*se) ) se++;
418+
while ( *se && isdigit_c(*se) ) se++;
418419
if ( *se==']' ) ss = se + 1;
419420
}
420-
while ( *ss && (*ss=='#' || isspace(*ss)) ) ss++;
421+
while ( *ss && (*ss=='#' || isspace_c(*ss)) ) ss++;
421422
if ( !*ss ) error("Could not parse the header field \"%s\": %s\n", cols->off[i],dat->line.s);
422423
cols->off[i] = ss;
423424
khash_str2int_set(dat->hdr.name2idx, cols->off[i], i);

0 commit comments

Comments
 (0)