cms.c 951 B

12345678910111213141516171819202122232425262728293031323334
  1. /*
  2. Copyright (c) 1990-1999 Info-ZIP. All rights reserved.
  3. See the accompanying file LICENSE, version 1999-Oct-05 or later
  4. (the contents of which are also included in zip.h) for terms of use.
  5. If, for some reason, both of these files are missing, the Info-ZIP license
  6. also may be found at: ftp://ftp.cdrom.com/pub/infozip/license.html
  7. */
  8. /*
  9. * VM/CMS specific things.
  10. */
  11. #include "zip.h"
  12. int procname(n, caseflag)
  13. char *n; /* name to process */
  14. int caseflag; /* true to force case-sensitive match */
  15. /* Process a name or sh expression to operate on (or exclude). Return
  16. an error code in the ZE_ class. */
  17. {
  18. FILE *stream;
  19. if (strcmp(n, "-") == 0) /* if compressing stdin */
  20. return newname(n, 0, caseflag);
  21. else {
  22. if ((stream = fopen(n, "r")) != (FILE *)NULL)
  23. {
  24. fclose(stream);
  25. return newname(n, 0, caseflag);
  26. }
  27. else return ZE_MISS;
  28. }
  29. return ZE_OK;
  30. }