From 49c29e16b31ce35e81be210bc74a3834530bb9e0 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Tue, 14 Aug 2007 09:33:55 -0400 Subject: 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 --- lib/libalpm/be_files.c | 36 ------------------------------------ 1 file changed, 36 deletions(-) (limited to 'lib/libalpm/be_files.c') 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); } -- cgit v1.2.3-24-g4f1b