patch-fileio_c 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. $Id: update-patches 24 2008-08-31 14:56:13Z wbx $
  2. --- screen-4.0.3.orig/fileio.c 2003-09-08 16:25:28.000000000 +0200
  3. +++ screen-4.0.3/fileio.c 2008-10-08 14:07:52.000000000 +0200
  4. @@ -96,7 +96,7 @@ char *rcfile;
  5. if (rcfile)
  6. {
  7. - char *rcend = rindex(rc_name, '/');
  8. + char *rcend = strrchr(rc_name, '/');
  9. if (*rcfile != '/' && rcend && (rcend - rc_name) + strlen(rcfile) + 2 < sizeof(buf))
  10. {
  11. strncpy(buf, rc_name, rcend - rc_name + 1);
  12. @@ -169,7 +169,7 @@ char *rcfilename;
  13. }
  14. while (fgets(buf, sizeof buf, fp) != NULL)
  15. {
  16. - if ((p = rindex(buf, '\n')) != NULL)
  17. + if ((p = strrchr(buf, '\n')) != NULL)
  18. *p = '\0';
  19. if ((argc = Parse(buf, sizeof buf, args, argl)) == 0)
  20. continue;
  21. @@ -216,7 +216,7 @@ char *rcfilename;
  22. }
  23. for (p = args[1]; p && *p; p = cp)
  24. {
  25. - if ((cp = index(p, '|')) != 0)
  26. + if ((cp = strchr(p, '|')) != 0)
  27. *cp++ = '\0';
  28. len = strlen(p);
  29. if (p[len - 1] == '*')
  30. @@ -501,7 +501,7 @@ int dump;
  31. }
  32. break;
  33. case DUMP_TERMCAP:
  34. - if ((p = index(MakeTermcap(fore->w_aflag), '=')) != NULL)
  35. + if ((p = strchr(MakeTermcap(fore->w_aflag), '=')) != NULL)
  36. {
  37. fputs(++p, f);
  38. putc('\n', f);