summaryrefslogtreecommitdiff
path: root/lib/libalpm/be_files.c
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2007-08-14 09:33:55 -0400
committerDan McGee <dan@archlinux.org>2007-08-14 09:33:55 -0400
commit49c29e16b31ce35e81be210bc74a3834530bb9e0 (patch)
tree6af42b0e318e257d55a41c125c479cf6609c5225 /lib/libalpm/be_files.c
parent47ee89ada9d13935510ef92541649901789c23c8 (diff)
downloadpacman-49c29e16b31ce35e81be210bc74a3834530bb9e0.tar.xz
Code cleanup
Remove the commented desc_localized stuff, we can find it later in version control. Also remove some unnecessary includes of the stat header and use -fstack-protector-all which is a bit more broad. Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'lib/libalpm/be_files.c')
-rw-r--r--lib/libalpm/be_files.c36
1 files changed, 0 insertions, 36 deletions
diff --git a/lib/libalpm/be_files.c b/lib/libalpm/be_files.c
index ea00563e..dc89f32f 100644
--- a/lib/libalpm/be_files.c
+++ b/lib/libalpm/be_files.c
@@ -235,10 +235,6 @@ int _alpm_db_read(pmdb_t *db, pmpkg_t *info, pmdbinfrq_t inforeq)
struct stat buf;
char path[PATH_MAX+1];
char line[513];
- /*
- alpm_list_t *tmplist;
- char *locale;
- */
ALPM_LOG_FUNC;
@@ -303,32 +299,6 @@ int _alpm_db_read(pmdb_t *db, pmpkg_t *info, pmdbinfrq_t inforeq)
if(fgets(info->desc, sizeof(info->desc), fp) == NULL) {
goto error;
}
- /*
- while(fgets(line, 512, fp) && strlen(_alpm_strtrim(line))) {
- info->desc_localized = alpm_list_add(info->desc_localized, strdup(line));
- PKG_
- }
-
- if((locale = setlocale(LC_ALL, "")) == NULL) { //To fix segfault when locale invalid
- setenv("LC_ALL", "C", 1);
- locale = setlocale(LC_ALL, "");
- }
-
- if(info->desc_localized && !info->desc_localized->next) {
- snprintf(info->desc, 512, "%s", (char*)info->desc_localized->data);
- } else {
- for (tmplist = info->desc_localized; tmplist; tmplist = tmplist->next) {
- if (tmplist->data && strncmp(tmplist->data, locale, strlen(locale))) {
- strncpy(info->desc, (char *)info->desc_localized->data, sizeof(info->desc));
- } else {
- char *p = (char *)tmplist->data;
- p += strlen(locale) + 1;
- strncpy(info->desc, p, sizeof(info->desc));
- break;
- }
- }
- }
- */
_alpm_strtrim(info->desc);
} else if(!strcmp(line, "%GROUPS%")) {
while(fgets(line, 512, fp) && strlen(_alpm_strtrim(line))) {
@@ -545,12 +515,6 @@ int _alpm_db_write(pmdb_t *db, pmpkg_t *info, pmdbinfrq_t inforeq)
fprintf(fp, "%%NAME%%\n%s\n\n"
"%%VERSION%%\n%s\n\n", info->name, info->version);
if(info->desc[0]) {
- /*fputs("%DESC%\n", fp);
- for(lp = info->desc_localized; lp; lp = lp->next) {
- fprintf(fp, "%s\n", (char *)lp->data);
- }
- fprintf(fp, "\n");
- */
fprintf(fp, "%%DESC%%\n"
"%s\n\n", info->desc);
}