Commit patch to not break on spaces. master
authorDiane Trout <diane@caltech.edu>
Thu, 6 Dec 2012 20:09:20 +0000 (12:09 -0800)
committerDiane Trout <diane@caltech.edu>
Thu, 6 Dec 2012 20:09:20 +0000 (12:09 -0800)
debian/changelog
debian/patches/series
debian/patches/spaces-in-sam [new file with mode: 0644]

index 8c0543a8cd5516dc805e9c00c6b01f6018b7d005..84dc9c89f9a989cc6285dee58540934ad717659a 100644 (file)
@@ -1,3 +1,9 @@
+bowtie (0.12.7-3~ppa1) UNRELEASED; urgency=low
+
+  * Patch sam.cpp to not stop writing the header on the first space.
+
+ -- Diane Trout <diane@caltech.edu>  Thu, 06 Dec 2012 12:08:23 -0800
+
 bowtie (0.12.7-3) unstable; urgency=low
 
   * debian/patches/use-dpkg-buildflags.patch: Regard LDFLAGS/CPPFLAGS
index 99821597d6a4796657a0961b89342461205d234f..89efa8e612d8e7ac4ae924ec79b5541fe7294a9b 100644 (file)
@@ -1,2 +1,3 @@
+spaces-in-sam
 gcc-4.7.patch
 use-dpkg-buildflags.patch
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];
+               }
+       }