aboutsummaryrefslogtreecommitdiff
path: root/coreutils/sort.c
diff options
context:
space:
mode:
authorbeppu <beppu@69ca8d6d-28ef-0310-b511-8ec308f3f277>1999-12-22 17:57:31 +0000
committerbeppu <beppu@69ca8d6d-28ef-0310-b511-8ec308f3f277>1999-12-22 17:57:31 +0000
commite872680cec07750ca0eaf8460b9d849eef15cfba (patch)
tree5d03c4e7c4ba676fef529c52a4a55c46e246259e /coreutils/sort.c
parent98374391f9abe49cfdf20592e03b1d5d4eb7db1b (diff)
downloadbusybox-w32-e872680cec07750ca0eaf8460b9d849eef15cfba.tar.gz
busybox-w32-e872680cec07750ca0eaf8460b9d849eef15cfba.tar.bz2
busybox-w32-e872680cec07750ca0eaf8460b9d849eef15cfba.zip
added hooks for sort
git-svn-id: svn://busybox.net/trunk/busybox@257 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'coreutils/sort.c')
-rw-r--r--coreutils/sort.c24
1 files changed, 22 insertions, 2 deletions
diff --git a/coreutils/sort.c b/coreutils/sort.c
index d82351797..f3f9fca1d 100644
--- a/coreutils/sort.c
+++ b/coreutils/sort.c
@@ -90,6 +90,17 @@ line_newFromFile(FILE *src)
90 return NULL; 90 return NULL;
91} 91}
92 92
93/* Line destructor */
94static Line *
95line_release(Line *self)
96{
97 if (self->data) {
98 free(self->data);
99 free(self);
100 }
101 return self;
102}
103
93 104
94/* Comparison */ 105/* Comparison */
95 106
@@ -148,7 +159,16 @@ list_writeToFile(List *self, FILE* dst)
148static List * 159static List *
149list_release(List *self) 160list_release(List *self)
150{ 161{
151 return self; 162 Line *i;
163 Line *die;
164
165 i = self->head;
166 while (i) {
167 die = i;
168 i = die->next;
169 line_delete(die);
170 }
171 return self; /* bad poetry? */
152} 172}
153 173
154 174
@@ -195,4 +215,4 @@ sort_main(int argc, char **argv)
195 exit(0); 215 exit(0);
196} 216}
197 217
198/* $Id: sort.c,v 1.2 1999/12/22 00:30:29 beppu Exp $ */ 218/* $Id: sort.c,v 1.3 1999/12/22 17:57:31 beppu Exp $ */