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_local.c | |
parent | 573260556db49c62f5cf751f53812b7e06c1decb (diff) |
-rw-r--r-- | lib/libalpm/be_local.c | 12 |
diff --git a/lib/libalpm/be_local.c b/lib/libalpm/be_local.c index 261ad871..49661e24 100644 --- a/lib/libalpm/be_local.c +++ b/lib/libalpm/be_local.c @@ -500,7 +500,7 @@ static char *get_pkgpath(alpm_db_t *db, alpm_pkg_t *info) #define READ_NEXT() do { \ if(fgets(line, sizeof(line), fp) == NULL && !feof(fp)) goto error; \ - _alpm_strtrim(line); \ + _alpm_strip_newline(line); \ } while(0) #define READ_AND_STORE(f) do { \ @@ -510,8 +510,8 @@ static char *get_pkgpath(alpm_db_t *db, alpm_pkg_t *info) #define READ_AND_STORE_ALL(f) do { \ char *linedup; \ - READ_NEXT(); \ - if(strlen(line) == 0) break; \ + if(fgets(line, sizeof(line), fp) == NULL && !feof(fp)) goto error; \ + if(_alpm_strip_newline(line) == 0) break; \ STRDUP(linedup, line, goto error); \ f = alpm_list_add(f, linedup); \ } while(1) /* note the while(1) and not (0) */ @@ -629,12 +629,12 @@ static int local_db_read(alpm_pkg_t *info, alpm_dbinfrq_t inforeq) goto error; } while(fgets(line, sizeof(line), fp)) { - _alpm_strtrim(line); + _alpm_strip_newline(line); if(strcmp(line, "%FILES%") == 0) { size_t files_count = 0, files_size = 0; alpm_file_t *files = NULL; - while(fgets(line, sizeof(line), fp) && strlen(_alpm_strtrim(line))) { + while(fgets(line, sizeof(line), fp) && _alpm_strip_newline(line)) { if(files_count >= files_size) { size_t old_size = files_size; if(files_size == 0) { @@ -661,7 +661,7 @@ static int local_db_read(alpm_pkg_t *info, alpm_dbinfrq_t inforeq) info->files.count = files_count; info->files.files = files; } else if(strcmp(line, "%BACKUP%") == 0) { - while(fgets(line, sizeof(line), fp) && strlen(_alpm_strtrim(line))) { + while(fgets(line, sizeof(line), fp) && _alpm_strip_newline(line)) { alpm_backup_t *backup; CALLOC(backup, 1, sizeof(alpm_backup_t), goto error); if(_alpm_split_backup(line, &backup)) { |