diff --git a/commands/CmdRS.c b/commands/CmdRS.c index fb01bd68..4ed1f16b 100644 --- a/commands/CmdRS.c +++ b/commands/CmdRS.c @@ -635,9 +635,17 @@ cmdSelectArea( int i; for (i = 0; i < DBNumUserLayers; i++) { - if((TTMaskHasType(&mask, i)) && !(TTMaskHasType(&crec->dbw_visibleLayers, i))) + if ((TTMaskHasType(&mask, i)) && + !(TTMaskHasType(&crec->dbw_visibleLayers, i))) TTMaskClearType(&mask, i); } + + /* Remove L_CELL and L_LABEL if crec->dbw_flags indicates that + * they are not visible in the layout window. + */ + + if (!(crec->dbw_flags & DBW_SEELABELS)) TTMaskClearType(&mask, L_LABEL); + if (!(crec->dbw_flags & DBW_SEECELLS)) TTMaskClearType(&mask, L_CELL); } SelectArea(&scx, &mask, crec->dbw_bitmask, globmatch); } @@ -1027,7 +1035,7 @@ CmdSelect( /*-------------------------------------------------------------------- * Select everything under the box, perhaps looking only at - * particular layers, but only if its visible. + * particular layers, but only if it's visible. *-------------------------------------------------------------------- */ diff --git a/database/DBio.c b/database/DBio.c index c8173d9f..82828907 100644 --- a/database/DBio.c +++ b/database/DBio.c @@ -2016,8 +2016,8 @@ badTransform: if ((cellDef->cd_file != NULL) && (cellDef->cd_file[0] == '/')) { char *homedir = getenv("HOME"); - if (strncmp(cellDef->cd_file, homedir, strlen(homedir)) || - *(cellDef->cd_file + strlen(homedir)) != '/') + if (homedir && (strncmp(cellDef->cd_file, homedir, strlen(homedir)) || + *(cellDef->cd_file + strlen(homedir)) != '/')) { char *homeroot = strrchr(homedir, '/'); int rootlen = (int)(homeroot - homedir) + 1; @@ -2060,9 +2060,10 @@ badTransform: if (*pathptr == '~') { char *homedir = getenv("HOME"); - if (!strncmp(subCellDef->cd_file, homedir, strlen(homedir)) - && (!strcmp(subCellDef->cd_file + strlen(homedir), - pathptr + 1))) + if (homedir && (!strncmp(subCellDef->cd_file, homedir, + strlen(homedir)) && + (!strcmp(subCellDef->cd_file + strlen(homedir), + pathptr + 1)))) pathOK = TRUE; } else if (!strcmp(cwddir, pathptr)) pathOK = TRUE; @@ -2254,9 +2255,9 @@ badTransform: /* Check if the path is the same as the current directory */ char *homedir = getenv("HOME"); - if (!strncmp(cwddir, homedir, strlen(homedir)) + if (homedir && (!strncmp(cwddir, homedir, strlen(homedir)) && (!strcmp(cwddir + strlen(homedir), - pathptr + 1))) + pathptr + 1)))) pathOK = TRUE; } else if (!strcmp(cwddir, pathptr)) pathOK = TRUE; diff --git a/select/selCreate.c b/select/selCreate.c index dfa6c433..571714af 100644 --- a/select/selCreate.c +++ b/select/selCreate.c @@ -471,12 +471,11 @@ SelectArea(scx, types, xMask, globmatch) if (TTMaskHasType(types, L_LABEL)) { if (globmatch != NULL) - DBCellCopyGlobLabels(scx, &DBAllTypeBits, xMask, SelectUse, &labelArea, + DBCellCopyGlobLabels(scx, types, xMask, SelectUse, &labelArea, globmatch); else - DBCellCopyAllLabels(scx, &DBAllTypeBits, xMask, SelectUse, &labelArea); + DBCellCopyAllLabels(scx, types, xMask, SelectUse, &labelArea); } - else (void) DBCellCopyAllLabels(scx, types, xMask, SelectUse, &labelArea); /* Select cell uses. */