… | |
… | |
660 | sleep (1); |
660 | sleep (1); |
661 | if (e->fp) |
661 | if (e->fp) |
662 | fclose (e->fp); |
662 | fclose (e->fp); |
663 | if (openlog (e) == NULL) |
663 | if (openlog (e) == NULL) |
664 | continue; |
664 | continue; |
|
|
665 | if (fstat (fileno (e->fp), &stats) < 0) |
|
|
666 | continue; |
665 | } |
667 | } |
666 | |
668 | |
667 | /* HACK-3: stats can be uninitialised here (if the file didn't |
|
|
668 | * exist when stat() was called, but was recreated during the |
|
|
669 | * sleep(1)) */ |
|
|
670 | if (stats.st_ino != e->inode) |
669 | if (stats.st_ino != e->inode) |
671 | { /* file renamed? */ |
670 | { /* file renamed? */ |
672 | if (e->fp) |
671 | if (e->fp) |
673 | fclose (e->fp); |
672 | fclose (e->fp); |
674 | if (openlog (e) == NULL) |
673 | if (openlog (e) == NULL) |
… | |
… | |
741 | /* only calculate the continuation's width once */ |
740 | /* only calculate the continuation's width once */ |
742 | if (continuation_width == -1) |
741 | if (continuation_width == -1) |
743 | { |
742 | { |
744 | continuation_length = strlen(continuation); |
743 | continuation_length = strlen(continuation); |
745 | continuation_width = XmbTextEscapement (fontset, continuation, continuation_length); |
744 | continuation_width = XmbTextEscapement (fontset, continuation, continuation_length); |
746 | printf("continuation width is %d and length is %d\n", continuation_width, continuation_length); |
|
|
747 | } |
745 | } |
748 | |
746 | |
749 | do |
747 | do |
750 | { |
748 | { |
751 | const char *beg = p; |
749 | const char *beg = p; |
… | |
… | |
1147 | |
1145 | |
1148 | e->fname = xstrdup (fname); |
1146 | e->fname = xstrdup (fname); |
1149 | if (openlog (e) == NULL) |
1147 | if (openlog (e) == NULL) |
1150 | perror (fname), exit (1); |
1148 | perror (fname), exit (1); |
1151 | |
1149 | |
1152 | l = strlen (desc); |
1150 | e->desc = xstrdup (desc); |
1153 | /* HACK-6: width is in pixels now */ |
|
|
1154 | if (l > width - 2) /* must account for [ ] */ |
|
|
1155 | l = width - 2; |
|
|
1156 | e->desc = xmalloc (l + 1); |
|
|
1157 | memcpy (e->desc, desc, l); |
|
|
1158 | *(e->desc + l) = '\0'; |
|
|
1159 | } |
1151 | } |
1160 | |
1152 | |
1161 | e->color = GetColor (fcolor); |
1153 | e->color = GetColor (fcolor); |
1162 | e->partial = 0; |
1154 | e->partial = 0; |
1163 | e->next = NULL; |
1155 | e->next = NULL; |