/[pspp]/pspp/src/file-handle.q
ViewVC logotype

Diff of /pspp/src/file-handle.q

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

revision 1.17 by jmd, Fri Apr 29 01:02:14 2005 UTC revision 1.18 by blp, Mon May 2 06:21:20 2005 UTC
# Line 73  get_handle_with_name (const char *handle Line 73  get_handle_with_name (const char *handle
73    struct file_handle *iter;    struct file_handle *iter;
74    
75    for (iter = file_handles; iter != NULL; iter = iter->next)    for (iter = file_handles; iter != NULL; iter = iter->next)
76      if (!strcmp (handle_name, iter->name))      if (!strcasecmp (handle_name, iter->name))
77        return iter;        return iter;
78    return NULL;    return NULL;
79  }  }
# Line 109  get_handle_for_filename (const char *fil Line 109  get_handle_for_filename (const char *fil
109  int  int
110  cmd_file_handle (void)  cmd_file_handle (void)
111  {  {
112    char handle_name[9];    char handle_name[LONG_NAME_LEN + 1];
113    
114    struct cmd_file_handle cmd;    struct cmd_file_handle cmd;
115    struct file_handle *handle;    struct file_handle *handle;
116    
117    if (!lex_force_id ())    if (!lex_force_id ())
118      return CMD_FAILURE;      return CMD_FAILURE;
119    strcpy (handle_name, tokid);    st_trim_copy (handle_name, tokid, sizeof handle_name);
120    
121    handle = get_handle_with_name (handle_name);    handle = get_handle_with_name (handle_name);
122    if (handle != NULL)    if (handle != NULL)
123      {      {
124        msg (SE, _("File handle %s already refers to "        msg (SE, _("File handle %s already refers to file %s.  "
125                   "file %s.  File handle cannot be redefined within a "                   "File handles cannot be redefined within a session."),
126                   "session."),             handle_name, handle->filename);
            tokid, handle->filename);  
127        return CMD_FAILURE;        return CMD_FAILURE;
128      }      }
129    

Legend:
Removed from v.1.17  
changed lines
  Added in v.1.18

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26