X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Flanguage%2Fdictionary%2Fsys-file-info.c;h=441054e209b29b3dfdb7434038083dd6df11ce32;hb=refs%2Fbuilds%2F20120610000508%2Fpspp;hp=bb990c79d9e093aa28d292e2368faa34eaccdc13;hpb=261869b71aa60b8974c4a6b98e35b74af5d11de5;p=pspp diff --git a/src/language/dictionary/sys-file-info.c b/src/language/dictionary/sys-file-info.c index bb990c79d9..441054e209 100644 --- a/src/language/dictionary/sys-file-info.c +++ b/src/language/dictionary/sys-file-info.c @@ -81,7 +81,7 @@ cmd_sysfile_info (struct lexer *lexer, struct dataset *ds UNUSED) if (!h) return CMD_FAILURE; - reader = sfm_open_reader (h, &d, &info); + reader = sfm_open_reader (h, NULL, &d, &info); if (!reader) { fh_unref (h); @@ -377,12 +377,15 @@ static void display_attributes (struct tab_table *t, const struct attrset *set, int flags, int c, int r) { - struct attrset_iterator i; - struct attribute *attr; + struct attribute **attrs; + size_t n_attrs; + size_t i; - for (attr = attrset_first (set, &i); attr != NULL; - attr = attrset_next (set, &i)) + n_attrs = attrset_count (set); + attrs = attrset_sorted (set); + for (i = 0; i < n_attrs; i++) { + const struct attribute *attr = attrs[i]; const char *name = attribute_get_name (attr); size_t n_values; size_t i; @@ -401,6 +404,7 @@ display_attributes (struct tab_table *t, const struct attrset *set, int flags, r++; } } + free (attrs); } static void