Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Diff of /sml/branches/SMLNJ/src/runtime/c-libs/posix-filesys/readdir.c
ViewVC logotype

Diff of /sml/branches/SMLNJ/src/runtime/c-libs/posix-filesys/readdir.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 7, Sun Jan 18 00:59:30 1998 UTC revision 8, Sun Jan 18 01:01:29 1998 UTC
# Line 22  Line 22 
22  {  {
23      struct dirent      *dirent;      struct dirent      *dirent;
24    
25        while (TRUE) {
26      errno = 0;      errno = 0;
27      dirent = readdir(PTR_MLtoC(DIR, arg));      dirent = readdir(PTR_MLtoC(DIR, arg));
28      if (dirent == NIL(struct dirent *)) {      if (dirent == NIL(struct dirent *)) {
29        if (errno != 0)     /* Error occurred */        if (errno != 0)     /* Error occurred */
30          return RaiseSysError(msp, NIL(char *));                  return RAISE_SYSERR(msp, -1);
31        else                /* End of stream */        else                /* End of stream */
32          return ML_string0;          return ML_string0;
33      }      }
34            else {
35                char        *cp = dirent->d_name;
36                if ((cp[0] == '.')
37                && ((cp[1] == '\0') || ((cp[1] == '.') && (cp[2] == '\0'))))
38                    continue;
39      else      else
40        return ML_CString (msp, dirent->d_name);                  return ML_CString (msp, cp);
41            }
42        }
43    
44  } /* end of _ml_P_FileSys_readdir */  } /* end of _ml_P_FileSys_readdir */

Legend:
Removed from v.7  
changed lines
  Added in v.8

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0