#ifndef lint
#ifndef NOID
-static char elsieid[] = "@(#)zic.c 7.96";
+static char elsieid[] = "@(#)zic.c 7.99";
#endif /* !defined NOID */
#endif /* !defined lint */
/*
** Make links.
*/
- for (i = 0; i < nlinks; ++i)
+ for (i = 0; i < nlinks; ++i) {
+ eat(links[i].l_filename, links[i].l_linenum);
dolink(links[i].l_from, links[i].l_to);
- if (lcltime != NULL)
+ }
+ if (lcltime != NULL) {
+ eat("command line", 1);
dolink(lcltime, TZDEFAULT);
- if (psxrules != NULL)
+ }
+ if (psxrules != NULL) {
+ eat("command line", 1);
dolink(psxrules, TZDEFRULES);
+ }
return (errors == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
}
if (mkdirs(toname) != 0)
(void) exit(EXIT_FAILURE);
+
result = link(fromname, toname);
#if (HAVE_SYMLINK - 0)
if (result != 0) {
- result = symlink(fromname, toname);
+ char *s = (char *) tofile;
+ register char * symlinkcontents = NULL;
+ while ((s = strchr(s+1, '/')) != NULL)
+ symlinkcontents = ecatalloc(symlinkcontents, "../");
+ symlinkcontents = ecatalloc(symlinkcontents, fromfile);
+
+ result = symlink(symlinkcontents, toname);
if (result == 0)
warning(_("hard link failed, symbolic link used"));
+ ifree(symlinkcontents);
}
#endif
if (result != 0) {