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 |
} |
} |
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 |
|
|