index : pacman | |
Archlinux32 fork of pacman | gitolite user |
summaryrefslogtreecommitdiff |
author | Dan McGee <dan@archlinux.org> | 2011-07-29 18:49:38 -0500 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2011-08-02 08:20:34 -0400 |
commit | cbaff216b3eca57b4fd717da53f43a6713722e95 (patch) | |
tree | 1ef21cb061959410a827c3123ca0e7a28f7610a6 /lib/libalpm/be_sync.c | |
parent | 573260556db49c62f5cf751f53812b7e06c1decb (diff) |
-rw-r--r-- | lib/libalpm/be_sync.c | 12 |
diff --git a/lib/libalpm/be_sync.c b/lib/libalpm/be_sync.c index 07356f0a..d4c71a8e 100644 --- a/lib/libalpm/be_sync.c +++ b/lib/libalpm/be_sync.c @@ -443,7 +443,8 @@ static int sync_db_populate(alpm_db_t *db) #define READ_NEXT() do { \ if(_alpm_archive_fgets(archive, &buf) != ARCHIVE_OK) goto error; \ - line = _alpm_strtrim(buf.line); \ + line = buf.line; \ + _alpm_strip_newline(line); \ } while(0) #define READ_AND_STORE(f) do { \ @@ -453,9 +454,9 @@ static int sync_db_populate(alpm_db_t *db) #define READ_AND_STORE_ALL(f) do { \ char *linedup; \ - READ_NEXT(); \ - if(strlen(line) == 0) break; \ - STRDUP(linedup, line, goto error); \ + if(_alpm_archive_fgets(archive, &buf) != ARCHIVE_OK) goto error; \ + if(_alpm_strip_newline(buf.line) == 0) break; \ + STRDUP(linedup, buf.line, goto error); \ f = alpm_list_add(f, linedup); \ } while(1) /* note the while(1) and not (0) */ @@ -493,7 +494,8 @@ static int sync_db_read(alpm_db_t *db, struct archive *archive, || strcmp(filename, "deltas") == 0) { int ret; while((ret = _alpm_archive_fgets(archive, &buf)) == ARCHIVE_OK) { - char *line = _alpm_strtrim(buf.line); + char *line = buf.line; + _alpm_strip_newline(line); if(strcmp(line, "%NAME%") == 0) { READ_NEXT(); |