summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2011-02-16 18:07:01 +0100
committerDaniel Friesel <derf@finalrewind.org>2011-02-16 18:07:01 +0100
commitd634583eeefe12b832a63c301d8977c5c6235f20 (patch)
tree48b44bbeb0f7759c48f46fbc983468dcbed39084 /src
parent15b8e8322839082187d45cd3de8ceb99197d86bc (diff)
imlib.c indentation fixes
Diffstat (limited to 'src')
-rw-r--r--src/imlib.c70
1 files changed, 35 insertions, 35 deletions
diff --git a/src/imlib.c b/src/imlib.c
index 9f3437b..7a059d4 100644
--- a/src/imlib.c
+++ b/src/imlib.c
@@ -440,10 +440,10 @@ char *feh_http_load_image(char *url)
} /* while read */
close(sockno);
fclose(fp);
- } else if (opt.libcurl_http) {
- CURL *curl;
+ } else {
+ CURL *curl;
CURLcode res;
- char *sfn;
+ char *sfn;
FILE *sfp;
int fd = -1;
char *ebuff;
@@ -451,45 +451,45 @@ char *feh_http_load_image(char *url)
curl = curl_easy_init();
if (!curl) {
- weprintf("open url: libcurl initialization failure");
- return NULL;
+ weprintf("open url: libcurl initialization failure");
+ return NULL;
}
sfn = estrjoin("_", tmpname, "XXXXXX", NULL);
free(tmpname);
fd = mkstemp(sfn);
if (fd != -1) {
- sfp = fdopen(fd, "w+");
- if (sfp != NULL) {
- curl_easy_setopt(curl, CURLOPT_URL, url);
- curl_easy_setopt(curl, CURLOPT_WRITEDATA, sfp);
- /* curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L); */
- ebuff = emalloc(CURL_ERROR_SIZE);
- curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, ebuff);
- curl_easy_setopt(curl, CURLOPT_FAILONERROR, 1L);
-
- res = curl_easy_perform(curl);
- curl_easy_cleanup(curl);
- if (res != CURLE_OK) {
- weprintf("open url: %s", ebuff);
- unlink(sfn);
- close(fd);
- free(sfn);
- sfn = NULL;
- }
-
- free(ebuff);
- fclose(sfp);
- return sfn;
- } else {
- weprintf("open url: fdopen failed:");
- free(sfn);
- unlink(sfn);
- close(fd);
- }
+ sfp = fdopen(fd, "w+");
+ if (sfp != NULL) {
+ curl_easy_setopt(curl, CURLOPT_URL, url);
+ curl_easy_setopt(curl, CURLOPT_WRITEDATA, sfp);
+ /* curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L); */
+ ebuff = emalloc(CURL_ERROR_SIZE);
+ curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, ebuff);
+ curl_easy_setopt(curl, CURLOPT_FAILONERROR, 1L);
+
+ res = curl_easy_perform(curl);
+ curl_easy_cleanup(curl);
+ if (res != CURLE_OK) {
+ weprintf("open url: %s", ebuff);
+ unlink(sfn);
+ close(fd);
+ free(sfn);
+ sfn = NULL;
+ }
+
+ free(ebuff);
+ fclose(sfp);
+ return sfn;
+ } else {
+ weprintf("open url: fdopen failed:");
+ free(sfn);
+ unlink(sfn);
+ close(fd);
+ }
} else {
- weprintf("open url: mkstemp failed:");
- free(sfn);
+ weprintf("open url: mkstemp failed:");
+ free(sfn);
}
curl_easy_cleanup(curl);
return NULL;