summaryrefslogtreecommitdiffstats
path: root/stream/cookies.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-04-13 18:00:51 +0200
committerwm4 <wm4@nowhere>2014-04-13 18:03:01 +0200
commit78128bddda4bcea1f256fc13cc33fa2652ed277c (patch)
tree35bf6596cb8e2d7927618845833c3ee36534f890 /stream/cookies.c
parent44f382cf98564c0fe08bdc78579c284362cd6f3c (diff)
downloadmpv-78128bddda4bcea1f256fc13cc33fa2652ed277c.tar.bz2
mpv-78128bddda4bcea1f256fc13cc33fa2652ed277c.tar.xz
Kill all tabs
I hate tabs. This replaces all tabs in all source files with spaces. The only exception is old-makefile. The replacement was made by running the GNU coreutils "expand" command on every file. Since the replacement was automatic, it's possible that some formatting was destroyed (but perhaps only if it was assuming that the end of a tab does not correspond to aligning the end to multiples of 8 spaces).
Diffstat (limited to 'stream/cookies.c')
-rw-r--r--stream/cookies.c62
1 files changed, 31 insertions, 31 deletions
diff --git a/stream/cookies.c b/stream/cookies.c
index a12122f0ac..f8bc852259 100644
--- a/stream/cookies.c
+++ b/stream/cookies.c
@@ -55,7 +55,7 @@ static char *col_dup(void *talloc_ctx, const char *src)
{
int length = 0;
while (src[length] > 31)
- length++;
+ length++;
return talloc_strndup(talloc_ctx, src, length);
}
@@ -67,13 +67,13 @@ static int parse_line(char **ptr, char *cols[7])
cols[0] = *ptr;
for (col = 1; col < 7; col++) {
- for (; (**ptr) > 31; (*ptr)++);
- if (**ptr == 0)
- return 0;
- (*ptr)++;
- if ((*ptr)[-1] != 9)
- return 0;
- cols[col] = (*ptr);
+ for (; (**ptr) > 31; (*ptr)++);
+ if (**ptr == 0)
+ return 0;
+ (*ptr)++;
+ if ((*ptr)[-1] != 9)
+ return 0;
+ cols[col] = (*ptr);
}
return 1;
@@ -89,32 +89,32 @@ static char *load_file(struct mp_log *log, const char *filename, int64_t * lengt
fd = open(filename, O_RDONLY | O_CLOEXEC);
if (fd < 0) {
- mp_verbose(log, "Could not open");
- goto err_out;
+ mp_verbose(log, "Could not open");
+ goto err_out;
}
*length = lseek(fd, 0, SEEK_END);
if (*length < 0) {
- mp_verbose(log, "Could not find EOF");
- goto err_out;
+ mp_verbose(log, "Could not find EOF");
+ goto err_out;
}
if (*length > SIZE_MAX - 1) {
- mp_verbose(log, "File too big, could not malloc.");
- goto err_out;
+ mp_verbose(log, "File too big, could not malloc.");
+ goto err_out;
}
lseek(fd, 0, SEEK_SET);
if (!(buffer = malloc(*length + 1))) {
- mp_verbose(log, "Could not malloc.");
- goto err_out;
+ mp_verbose(log, "Could not malloc.");
+ goto err_out;
}
if (read(fd, buffer, *length) != *length) {
- mp_verbose(log, "Read is behaving funny.");
- goto err_out;
+ mp_verbose(log, "Read is behaving funny.");
+ goto err_out;
}
close(fd);
buffer[*length] = 0;
@@ -137,22 +137,22 @@ static struct cookie_list_type *load_cookies_from(void *ctx,
ptr = file = load_file(log, filename, &length);
if (!ptr)
- return NULL;
+ return NULL;
struct cookie_list_type *list = NULL;
while (*ptr) {
- char *cols[7];
- if (parse_line(&ptr, cols)) {
- struct cookie_list_type *new;
- new = talloc_zero(ctx, cookie_list_t);
- new->name = col_dup(new, cols[5]);
- new->value = col_dup(new, cols[6]);
- new->path = col_dup(new, cols[2]);
- new->domain = col_dup(new, cols[0]);
- new->secure = (*(cols[3]) == 't') || (*(cols[3]) == 'T');
- new->next = list;
- list = new;
- }
+ char *cols[7];
+ if (parse_line(&ptr, cols)) {
+ struct cookie_list_type *new;
+ new = talloc_zero(ctx, cookie_list_t);
+ new->name = col_dup(new, cols[5]);
+ new->value = col_dup(new, cols[6]);
+ new->path = col_dup(new, cols[2]);
+ new->domain = col_dup(new, cols[0]);
+ new->secure = (*(cols[3]) == 't') || (*(cols[3]) == 'T');
+ new->next = list;
+ list = new;
+ }
}
free(file);
return list;