git: 9front

Download patch

ref: 38df3f57a0b62e7456e4e7176def3924b5c6b03a
parent: 7c79170a48a392ce86d47e0aae8cfd363ac51761
author: cinap_lenrek <cinap_lenrek@centraldogma>
date: Fri Sep 2 23:26:44 EDT 2011

ptp: fix fallback case

--- a/sys/src/cmd/nusb/ptp/ptp.c
+++ b/sys/src/cmd/nusb/ptp/ptp.c
@@ -826,7 +826,7 @@
 				respond(r, nil);
 				return;
 			}
-			while(nod->data == nil){
+			if(nod->data == nil){
 				int offset, count, pos;
 
 				offset = r->ifcall.offset;
@@ -857,8 +857,8 @@
 			/* no break */
 		case Qthumb:
 			if(nod->data == nil){
-				p = nil;
 				np = 0;
+				p = nil;
 				if(ptprpc(r, TYPE(path)==Qthumb ? GetThumb : GetObject,
 					1|DataRecv, nod->handle, &p, &np) < 0){
 					free(p);
--