app-arch/arc/5.21o/1: arc-5.21o.patch
| File arc-5.21o.patch, 3.7 KB (added by thorn, 6 years ago) |
|---|
-
Makefile
diff -Naur arc-5.21o.orig/Makefile arc-5.21o/Makefile
old new 38 38 #SYSTEM = -DBSD=1 39 39 SYSTEM = -DSYSV=1 40 40 41 OPT = -O 41 OPT = -O2 -DNEED_ALPHASORT 42 42 # For MWC 3.0 on the Atari ST, use: 43 43 #CFLAGS = -VCOMPAC -VPEEP 44 44 CFLAGS = $(OPT) $(SYSTEM) 45 45 46 46 # GNU's gcc is very nice, if you've got it. Otherwise just cc. 47 47 #CC = cgcc -mshort -mbaserel 48 CC = cc48 #CC = cc 49 49 50 50 # tmclock is only needed on Unix systems... 51 51 TMCLOCK = tmclock.o -
arcdos.c
diff -Naur arc-5.21o.orig/arcdos.c arc-5.21o/arcdos.c
old new 33 33 #if BSD 34 34 #include <sys/time.h> 35 35 #else 36 #include < time.h> /* Sys V. Bleah. */36 #include <sys/time.h> /* Sys V. Bleah. */ 37 37 #if NEED_TIMEVAL 38 38 struct timeval { 39 39 long tv_sec; -
arcmisc.c
diff -Naur arc-5.21o.orig/arcmisc.c arc-5.21o/arcmisc.c
old new 8 8 #include "arc.h" 9 9 10 10 #include <string.h> 11 #include <dirent.h> 12 #include <errno.h> 11 13 #if BSD 12 14 #include <strings.h> 13 15 #endif … … 211 213 212 214 #endif 213 215 216 #if UNIX 217 218 #define DIRSIZ(d) (sizeof(struct dirent) + strlen(d->d_name) + 1) 219 #define INITIAL_SIZE 30 220 221 int 222 scandir(name, dirlist, selector, sorter) 223 const char *name; 224 struct dirent ***dirlist; 225 int (*selector)(); 226 int (*sorter)(); 227 { 228 static struct dirent *E; 229 struct dirent **names; 230 DIR *Dp; 231 int i; 232 int size = INITIAL_SIZE; 233 234 if (!(names = (struct dirent **) malloc(size * sizeof names[0])) || 235 access(name, R_OK | X_OK) || !(Dp = opendir(name))) 236 return -1; 237 238 /* Read entries in the directory. */ 239 240 for (i = 0; (E = readdir(Dp)); ) 241 if (selector == NULL || (*selector)(E)) 242 { 243 /* User wants them all, or he wants this one. */ 244 if (++i >= size) 245 { 246 size <<= 1; 247 names = (struct dirent **) realloc(names, 248 size * sizeof names[0]); 249 if (names == NULL) 250 { 251 closedir(Dp); 252 free(&names); 253 return(-1); 254 } 255 } 256 257 /* Copy the entry. */ 258 names[i - 1] = (struct dirent *) malloc(DIRSIZ(E)); 259 if (names[i - 1] == NULL) 260 { 261 closedir(Dp); 262 free(&names); 263 return(-1); 264 } 265 strcpy(names[i - 1]->d_name, E->d_name); 266 } 267 268 /* Close things off. */ 269 names = (struct dirent **) realloc(names, 270 (i + 1) * sizeof names[0]); 271 names[i] = 0; 272 *dirlist = names; 273 closedir(Dp); 274 275 /* Sort? */ 276 if (i && sorter) 277 qsort((char *)names, i, sizeof names[0], sorter); 278 279 return i; 280 } 281 #endif 282 214 283 VOID 215 284 upper(string) 216 285 char *string; … … 309 378 static char **NameList; 310 379 static char namecopy[STRLEN], *dirname; 311 380 #if UNIX 312 int alphasort();313 int scandir();381 //int alphasort(); 382 //int scandir(); 314 383 #endif /* UNIX */ 384 315 385 int fmatch(); 316 386 static int Nnum = 0, ii; 317 387
