Commit patch to not break on spaces.
[bowtie.git] / debian / patches / spaces-in-sam
1 Index: bowtie/sam.cpp
2 ===================================================================
3 --- bowtie.orig/sam.cpp 2012-12-06 12:06:23.118153141 -0800
4 +++ bowtie/sam.cpp      2012-12-06 12:07:16.122153504 -0800
5 @@ -51,6 +51,14 @@
6         os.writeString(ss.str());
7  }
8  
9 +static inline int iseol(int c)
10 +{
11 +  if (c == '\n' || c == '\r') {
12 +    return true;
13 +  } 
14 +  return false;
15 +}
16
17  /**
18   * Append a SAM output record for an unaligned read.
19   */
20 @@ -68,12 +76,12 @@
21         if(h.mate > 0) {
22                 // truncate final 2 chars
23                 for(int i = 0; i < (int)seqan::length(h.patName)-2; i++) {
24 -                       if(isspace(h.patName[i])) break;
25 +                       if(iseol(h.patName[i])) break;
26                         ss << h.patName[i];
27                 }
28         } else {
29                 for(int i = 0; i < (int)seqan::length(h.patName); i++) {
30 -                       if(isspace(h.patName[i])) break;
31 +                       if(iseol(h.patName[i])) break;
32                         ss << h.patName[i];
33                 }
34         }