Репозитории ALT
S: | 1.6.14-alt2 |
5.1: | 1.6.11-alt7 |
4.1: | 1.6.11-alt3.M41.1 |
4.0: | 1.6.11-alt2 |
+backports: | 1.6.11-alt3.M40.1 |
3.0: | 1.6.5-alt1 |
Другие репозитории
Upstream: | 1.6.11 |
Группа :: Науки/Химия
Пакет: chemtool
Главная Изменения Спек Патчи Sources Загрузить Gear Bugs and FR Repocop
Патч: chemtool-cht.patch
Скачать
Скачать
diff -uNr chemtool-1.6.11/main.c chemtool-1.6.11-new/main.c
--- chemtool-1.6.11/main.c 2007-08-26 14:49:26 +0300
+++ chemtool-1.6.11-new/main.c 2008-05-16 00:42:45 +0300
@@ -2938,7 +2938,7 @@
or save operations as defined by the current i/o mode and displays error
message dialog if necessary */
{
- int error;
+ int error, length;
char errtext[255];
char oldname[512];
char *tempstr;
@@ -2950,6 +2950,23 @@
strcpy (oldname, filename);
strcpy (filename,
gtk_file_selection_get_filename (GTK_FILE_SELECTION (fs)));
+
+ while ((length = strlen(filename)) > 507 )
+ {
+ snprintf (errtext, 255, "Input filename %s contains %d\r characters and this too long.\n", filename, strlen(filename));
+ gtk_label_set_text (GTK_LABEL (message), errtext);
+ gtk_widget_show (messagew);
+ gtk_grab_add (messagew);
+ strcpy (filename, oldname);
+ snprintf (errtext,255, "Chemtool 1.6.11");
+ gtk_window_set_title (GTK_WINDOW (window), errtext);
+
+ return;
+ }
+
+ if (strstr(filename, ".cht") == NULL)
+ strcat(filename, ".cht");
+
if (datadir == NULL || (int)strlen (datadir) == 0)
{
tempstr = strrchr (filename, '/');