Commit patch to not break on spaces.
[bowtie.git] / debian / patches / spaces-in-sam
diff --git a/debian/patches/spaces-in-sam b/debian/patches/spaces-in-sam
new file mode 100644 (file)
index 0000000..62bc5b9
--- /dev/null
@@ -0,0 +1,34 @@
+Index: bowtie/sam.cpp
+===================================================================
+--- bowtie.orig/sam.cpp        2012-12-06 12:06:23.118153141 -0800
++++ bowtie/sam.cpp     2012-12-06 12:07:16.122153504 -0800
+@@ -51,6 +51,14 @@
+       os.writeString(ss.str());
+ }
++static inline int iseol(int c)
++{
++  if (c == '\n' || c == '\r') {
++    return true;
++  } 
++  return false;
++}
++ 
+ /**
+  * Append a SAM output record for an unaligned read.
+  */
+@@ -68,12 +76,12 @@
+       if(h.mate > 0) {
+               // truncate final 2 chars
+               for(int i = 0; i < (int)seqan::length(h.patName)-2; i++) {
+-                      if(isspace(h.patName[i])) break;
++                      if(iseol(h.patName[i])) break;
+                       ss << h.patName[i];
+               }
+       } else {
+               for(int i = 0; i < (int)seqan::length(h.patName); i++) {
+-                      if(isspace(h.patName[i])) break;
++                      if(iseol(h.patName[i])) break;
+                       ss << h.patName[i];
+               }
+       }