edit.c (most-5.0.0a) | : | edit.c (most-5.1.0) | ||
---|---|---|---|---|
/* | /* | |||
This file is part of MOST. | This file is part of MOST. | |||
Copyright (c) 1991, 1999, 2002, 2005, 2006, 2007 John E. Davis | Copyright (c) 1991, 1999, 2002, 2005-2018, 2019 John E. Davis | |||
This program is free software; you can redistribute it and/or modify it | This program is free software; you can redistribute it and/or modify it | |||
under the terms of the GNU General Public License as published by the Free | under the terms of the GNU General Public License as published by the Free | |||
Software Foundation; either version 2 of the License, or (at your option) | Software Foundation; either version 2 of the License, or (at your option) | |||
any later version. | any later version. | |||
This program is distributed in the hope that it will be useful, but WITHOUT | This program is distributed in the hope that it will be useful, but WITHOUT | |||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | |||
more details. | more details. | |||
skipping to change at line 99 | skipping to change at line 99 | |||
else if (quote_char == '\'') | else if (quote_char == '\'') | |||
{ | { | |||
*e++ = '"'; | *e++ = '"'; | |||
*e++ = '\''; | *e++ = '\''; | |||
} | } | |||
#endif | #endif | |||
*e = 0; | *e = 0; | |||
return efile; | return efile; | |||
#ifndef VMS | #ifndef VMS | |||
/* For a double-quoted string, only the following characters | /* For a double-quoted string, only the following characters | |||
* may be escaped with a backslash. Unfortuinately, escaping | * may be escaped with a backslash. Unfortunately, escaping | |||
* others such as &, *, |, etc will not work. | * others such as &, *, |, etc will not work. | |||
*/ | */ | |||
case '\\': case '$': case '"': case '`': case '\n': | case '\\': case '$': case '"': case '`': case '\n': | |||
*e++ = '\\'; | *e++ = '\\'; | |||
*e++ = ch; | *e++ = ch; | |||
break; | break; | |||
#endif | #endif | |||
default: | default: | |||
*e++ = ch; | *e++ = ch; | |||
} | } | |||
skipping to change at line 171 | skipping to change at line 171 | |||
if ((d == 0) && (s == 0)) | if ((d == 0) && (s == 0)) | |||
{ | { | |||
/* No %d, %s */ | /* No %d, %s */ | |||
_pSLsnprintf (cmd, sizeof_cmd, "%s \"%s\"", edit, efile); | _pSLsnprintf (cmd, sizeof_cmd, "%s \"%s\"", edit, efile); | |||
SLfree (efile); | SLfree (efile); | |||
return 0; | return 0; | |||
} | } | |||
if (d == 0) | if (d == 0) | |||
{ | { | |||
_pSLsnprintf (cmd, sizeof_cmd, edit, efile); | (void) _pSLsnprintf (cmd, sizeof_cmd, edit, efile); | |||
SLfree (efile); | SLfree (efile); | |||
return 0; | return 0; | |||
} | } | |||
if (d && s) | if (d && s) | |||
{ | { | |||
if (d == 1) | if (d == 1) | |||
_pSLsnprintf (cmd, sizeof_cmd, edit, Most_C_Line, efile); | (void) _pSLsnprintf (cmd, sizeof_cmd, edit, Most_C_Line, efile); | |||
else | else | |||
_pSLsnprintf (cmd, sizeof_cmd, edit, efile, Most_C_Line); | (void) _pSLsnprintf (cmd, sizeof_cmd, edit, efile, Most_C_Line); | |||
SLfree (efile); | SLfree (efile); | |||
return 0; | return 0; | |||
} | } | |||
most_message ("Unsupported Editor definition", 1); | most_message ("Unsupported Editor definition", 1); | |||
SLfree (efile); | SLfree (efile); | |||
return -1; | return -1; | |||
} | } | |||
End of changes. 5 change blocks. | ||||
5 lines changed or deleted | 5 lines changed or added |