mkmakefile.c (20395) | mkmakefile.c (20457) |
---|---|
1/* 2 * Copyright (c) 1993, 19801990 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 242 unchanged lines hidden (view full) --- 251read_files() 252{ 253 FILE *fp; 254 register struct file_list *tp, *pf; 255 register struct device *dp; 256 struct device *save_dp; 257 register struct opt *op; 258 char *wd, *this, *needs, *special, *depends, *clean; | 1/* 2 * Copyright (c) 1993, 19801990 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 242 unchanged lines hidden (view full) --- 251read_files() 252{ 253 FILE *fp; 254 register struct file_list *tp, *pf; 255 register struct device *dp; 256 struct device *save_dp; 257 register struct opt *op; 258 char *wd, *this, *needs, *special, *depends, *clean; |
259 char fname[32]; | 259 char fname[80]; |
260 int nreqs, first = 1, configdep, isdup, std, filetype, 261 imp_rule, no_obj, before_depend; 262 263 ftab = 0; | 260 int nreqs, first = 1, configdep, isdup, std, filetype, 261 imp_rule, no_obj, before_depend; 262 263 ftab = 0; |
264 (void) strcpy(fname, "../../conf/files"); | 264 (void) snprintf(fname, sizeof fname, "../../conf/files"); |
265openit: 266 fp = fopen(fname, "r"); 267 if (fp == 0) { 268 perror(fname); 269 exit(1); 270 } 271 if(ident == NULL) { 272 printf("no ident line specified\n"); --- 6 unchanged lines hidden (view full) --- 279 * [ compile-with "compile rule" [no-implicit-rule] ] 280 * [ dependency "dependency-list"] [ before-depend ] 281 * [ clean "file-list"] 282 */ 283 wd = get_word(fp); 284 if (wd == (char *)EOF) { 285 (void) fclose(fp); 286 if (first == 1) { | 265openit: 266 fp = fopen(fname, "r"); 267 if (fp == 0) { 268 perror(fname); 269 exit(1); 270 } 271 if(ident == NULL) { 272 printf("no ident line specified\n"); --- 6 unchanged lines hidden (view full) --- 279 * [ compile-with "compile rule" [no-implicit-rule] ] 280 * [ dependency "dependency-list"] [ before-depend ] 281 * [ clean "file-list"] 282 */ 283 wd = get_word(fp); 284 if (wd == (char *)EOF) { 285 (void) fclose(fp); 286 if (first == 1) { |
287 (void) sprintf(fname, "files.%s", machinename); | 287 (void) snprintf(fname, sizeof fname, "files.%s", machinename); |
288 first++; 289 goto openit; 290 } 291 if (first == 2) { | 288 first++; 289 goto openit; 290 } 291 if (first == 2) { |
292 (void) sprintf(fname, "files.%s", raise(ident)); | 292 (void) snprintf(fname, sizeof fname, "files.%s", raise(ident)); |
293 first++; 294 fp = fopen(fname, "r"); 295 if (fp != 0) 296 goto next; 297 } 298 return; 299 } 300 if (wd == 0) --- 511 unchanged lines hidden --- | 293 first++; 294 fp = fopen(fname, "r"); 295 if (fp != 0) 296 goto next; 297 } 298 return; 299 } 300 if (wd == 0) --- 511 unchanged lines hidden --- |