Conditional_USER_HAS_PIC() was leaving the download file open, causing the actual...
[citadel.git] / webcit / useredit.c
index d6d3a41ec2bbfcd783b3dbffe3befe1c6ee6fa34..ef72b6e201b5139909367e1048883aba884f1890 100644 (file)
@@ -481,6 +481,7 @@ int Conditional_USER_HAS_PIC(StrBuf *Target, WCTemplputParams *TP)
        StrBuf *Buf;
        const char *who;
        long len;
+       int r = 0;
 
        GetTemplateTokenString(Target, TP, 2, &who, &len);
 
@@ -488,15 +489,16 @@ int Conditional_USER_HAS_PIC(StrBuf *Target, WCTemplputParams *TP)
        serv_printf("OIMG _userpic_|%s", who);
        StrBuf_ServGetln(Buf);
        if (GetServerStatus(Buf, NULL) != 2) {
-               serv_puts("CLOS");
-               StrBuf_ServGetln(Buf);
-               GetServerStatus(Buf, NULL);
-               FreeStrBuf(&Buf);
-               return 1;
-       } else {
-               FreeStrBuf(&Buf);
-               return 0;
+               r = 1;
        }
+       else {
+               r = 0;
+       }
+       serv_puts("CLOS");
+       StrBuf_ServGetln(Buf);
+       GetServerStatus(Buf, NULL);
+       FreeStrBuf(&Buf);
+       return(r);
 }